File: /home/dtptviut/public_html/wp-content/plugins/comparisonfeed-wp/routers/jquery.compareFeed.php
<?php
/*
Router for jquery.compareFeed.pl
Gets the compareFeed JavaScript
*/
error_reporting(E_ERROR);
include('../settings.php');
header("Access-Control-Allow-Origin: *");
header("Access-Control-Allow-Headers: *");
header("Content-Type: application/javascript");
$curl = curl_init();
$options = array(
CURLOPT_URL => $feedDomain . 'cgi-bin/publisher/tools/jquery.compareFeed.pl?useTranslations=1&useMin=1&useNewFiltering=1',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_IPRESOLVE => CURL_IPRESOLVE_V4
);
curl_setopt_array($curl, $options);
$result = curl_exec($curl);
$httpCode = curl_getinfo($curl, CURLINFO_HTTP_CODE);
curl_close($curl);
/* Get wordpress plugins_url */
$plugins_url = $_GET['plugins_url'];
if ($httpCode == "200" || $httpCode == "302") {
header("Cache-Control: max-age=600, private");
// Generate ETag to facilitate caching.
$etag = md5($result);
if ($etag) {
header("ETag: " . $etag);
}
/* replace comparisonFeed and translation API URL with localized router */
if ($plugins_url) {
$result = str_replace('serverUrl+asjsUri+\'?',
'\''.$plugins_url.'/routers/comparisonFeed.php?data=asjs&', $result);
$result = str_replace('serverUrl+asjsUri+"?',
'"'.$plugins_url.'/routers/comparisonFeed.php?data=asjs&', $result);
$result = str_replace('serverUrl+scriptUri',
'\''.$plugins_url.'/routers/comparisonFeed.php\'', $result);
$result = str_replace('serverUrl+translationUri+\'?',
'\''.$plugins_url.'/routers/comparisonFeed.php?data=translations&', $result);
$result = str_replace('serverUrl+translationUri+"?',
'"'.$plugins_url.'/routers/comparisonFeed.php?data=translations&', $result);
}
print $result;
} else {
header('Location: '.$plugins_url.'/js/dist/jquery.compareFeed.min.js');
}
?>