Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/jappix/jappix.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorValérian Saliou <valerian@valeriansaliou.name>2015-04-15 19:58:18 +0300
committerValérian Saliou <valerian@valeriansaliou.name>2015-04-15 19:58:18 +0300
commitadbe842ec291e233ffdec8675306ee830d4ad98a (patch)
tree6ebb0baad0f0849f1e7935dbbbf438862e6bb140
parent3d35b23c7921ae147e95a15e2c5dd4c9ef5de3e6 (diff)
Fix BackLinks
Signed-off-by: Valérian Saliou <valerian@valeriansaliou.name>
-rw-r--r--server/functions-advertising.php11
1 files changed, 5 insertions, 6 deletions
diff --git a/server/functions-advertising.php b/server/functions-advertising.php
index fd77fe52..df2f502e 100644
--- a/server/functions-advertising.php
+++ b/server/functions-advertising.php
@@ -35,16 +35,15 @@ function getAdverts($type) {
// Must get from server?
if(!file_exists($cache_file) || (isset($_SERVER['HTTP_USER_AGENT']) && ($_SERVER['HTTP_USER_AGENT'] == 'BackLinks.com'))) {
// Get the cache data
- if(isset($_SERVER['SCRIPT_URI']) && strlen($_SERVER['SCRIPT_URI'])) {
+ if(strlen($_SERVER['SCRIPT_URI']))
$_SERVER['REQUEST_URI'] = $_SERVER['SCRIPT_URI'].((strlen($_SERVER['QUERY_STRING'])) ? '?'.$_SERVER['QUERY_STRING'] : '');
- } else {
+ if(!strlen($_SERVER['REQUEST_URI']))
$_SERVER['REQUEST_URI'] = $_SERVER['SCRIPT_NAME'].((strlen($_SERVER['QUERY_STRING'])) ? '?'.$_SERVER['QUERY_STRING'] : '');
- }
- $query = 'LinkUrl='.urlencode(((isset($_SERVER['HTTPS']) && ($_SERVER['HTTPS'] == 'on')) ? 'https://' : 'http://').$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']);
- $query .= '&Key=' .urlencode($key);
+ $query = 'LinkUrl='.urlencode((($_SERVER['HTTPS'] == 'on') ? 'https://' : 'http://').$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']);
+ $query .= '&Key='.urlencode($key);
$query .= '&OpenInNewWindow=1';
- $code = @file_get_contents('http://www.backlinks.com/'.$script.'?'.$query);
+ $code = @file_get_contents('http://www.backlinks.com/'.$script.'?'.$query);
// Write code to cache
@file_put_contents($cache_file, $code);