Skip to content

Commit

Permalink
Update user agent
Browse files Browse the repository at this point in the history
  • Loading branch information
fevangelou committed Feb 18, 2021
1 parent 7d1789b commit 6c88ad6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
8 changes: 4 additions & 4 deletions helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -229,10 +229,10 @@ public function getFirstImage($string)
public function getFile($url, $cacheTime=3600, $subFolderName='', $extensionName='mod_jw_srfr')
{
jimport('joomla.filesystem.file');

// Set a user agent
$userAgent = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.149 Safari/537.36';
$streamContext = stream_context_set_default(array('http' => array('user_agent' => '')));
$userAgent = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.150 Safari/537.36';
$defaultStreamContext = stream_context_set_default(array('http' => array('user_agent' => $userAgent)));

// Check cache folder
if ($subFolderName) {
Expand Down Expand Up @@ -303,7 +303,7 @@ public function getFile($url, $cacheTime=3600, $subFolderName='', $extensionName
$feedOutput = $body;
}
}

// Cleanup the content received
$feedOutput = preg_replace("#(\r\n|\n|\r|\t|\s+|<!--(.*?)-->)#s", " ", $feedOutput);
JFile::write($tmpFile, $feedOutput);
Expand Down
6 changes: 0 additions & 6 deletions redir.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,3 @@

// no direct access
defined('_JEXEC') or die('Restricted access');

/* Disable until a proper source & referrer check is in place
$url = (string) $_GET['url'];
$url = urldecode($url);
header('Location: '.$url);
*/

0 comments on commit 6c88ad6

Please sign in to comment.