|
Posted by gautam.bipin@gmail.com on 09/26/14 11:29
Guys,
i'm taking a opensource PHP code & customizing it to my need... but i
found a critical bug. Though, i asked help in its maling list about it
& reported the bug........ it seems like noone is responding to it.
anyways... i'm trying to roll on own fix and add it to the (say)
'grab_news.php' ( but i in no way good at php so here is i'm facing
problems)
here is the present situation:
http://my_website.com/grab_news.php?src=http://ANY_Website.com/rss.xml
i want to restrict this..... to only a list of specific URLS (inputs).
how do i do this????
-----------
Here is the fix i was trying to put in 'grab_news.php'
[code]
$restrict_url = array('http://www.trusted_website1.com/news.rss',
'http://www.trusted_website2.com/news.rss',
'http://www.trusted_website3.com/news.rss');
if (!strpos($src, $restrict_url)) {
$str.= "document.write('<p class=\"rss_item\">
<em>Error:</em> Feeds are allowed only from URLs
from the site http://" . $restrict_url . "</p></div>');\n";
} else {
// rest of script...
[/code]
"$src" is where the input URL from "grab_news.php?src= " is stored....
Where am i doing wrong??? any ideas/help would be highly appreciated.
Navigation:
[Reply to this message]
|