| Server IP : 195.130.67.5 / Your IP : 216.73.217.154 Web Server : Microsoft-IIS/10.0 System : Windows NT WEBSERVER1 10.0 build 17763 (Windows Server 2016) i586 User : IUSR ( 0) PHP Version : 7.4.19 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : C:/Old Sites/moke/administrator/components/com_myrssreader/js/ |
Upload File : |
<?php
/**
* @package My RSS Reader
* @copyright Copyright (C) 2010 FalsinSoft. All rights reserved.
* @license GNU/GPL
* @website http://falsinsoft.blogspot.com
* @email falsinsoft@gmail.com
*
*/
if(!isset($_GET['web_url'])
|| !isset($_GET['rand']))
{
return;
}
$web_url = strval($_GET['web_url']);
$joomla_base_path = dirname(__FILE__);
$pos = strrpos($joomla_base_path, 'administrator');
if($pos === false) return;
$joomla_base_path = substr($joomla_base_path, 0, $pos-1);
define('_JEXEC', 1);
define('JPATH_BASE', $joomla_base_path);
define('DS', DIRECTORY_SEPARATOR);
require_once(JPATH_BASE.DS.'components'.DS.'com_myrssreader'.DS.'simplepie'.DS.'simplepie.inc');
$sp = new SimplePie();
$sp->enable_cache(false);
$sp->set_timeout(10);
$sp->set_feed_url($web_url);
$sp->init();
$sp->handle_content_type();
if($sp->error() == false)
{
$forb_char = array(chr(34),chr(92),chr(47),chr(8),chr(12),chr(10),chr(13),chr(9));
$allow_char = array('\"','\\','\/','','','','','\t');
$title = $sp->get_title();
$web_url = $sp->get_link();
$rss_url = $sp->subscribe_url();
$description = $sp->get_description();
$title = preg_replace("/<.*?>/", "", $title);
$title = str_replace($forb_char, $allow_char, $title);
$description = preg_replace("/<.*?>/", "", $description);
$description = str_replace($forb_char, $allow_char, $description);
echo '{'
.' "title": "'.$title.'"'
.', "web_url": "'.$web_url.'"'
.', "rss_url": "'.$rss_url.'"'
.', "description": "'.$description.'"'
.'}';
}
$sp->__destruct();
unset($sp);
?>