<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: Sanitized PHP Include Navigation through GET variable</title>
	<atom:link href="http://usernamedenied.wordpress.com/2008/06/23/page-navigation-include-through-get-variable/feed/" rel="self" type="application/rss+xml" />
	<link>http://usernamedenied.wordpress.com/2008/06/23/page-navigation-include-through-get-variable/</link>
	<description>Reverse Engineering, Coding, Electronics and Projects</description>
	<lastBuildDate>Mon, 14 Sep 2009 07:24:50 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: usernamedenied</title>
		<link>http://usernamedenied.wordpress.com/2008/06/23/page-navigation-include-through-get-variable/#comment-43</link>
		<dc:creator>usernamedenied</dc:creator>
		<pubDate>Fri, 03 Apr 2009 06:10:05 +0000</pubDate>
		<guid isPermaLink="false">http://usernamedenied.wordpress.com/?p=49#comment-43</guid>
		<description>Hi, sure I will post an updated example soon.
It might take a while because I&#039;m currently doing an internship.

Thanks for the interest.</description>
		<content:encoded><![CDATA[<p>Hi, sure I will post an updated example soon.<br />
It might take a while because I&#8217;m currently doing an internship.</p>
<p>Thanks for the interest.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andrew</title>
		<link>http://usernamedenied.wordpress.com/2008/06/23/page-navigation-include-through-get-variable/#comment-42</link>
		<dc:creator>Andrew</dc:creator>
		<pubDate>Fri, 03 Apr 2009 05:29:02 +0000</pubDate>
		<guid isPermaLink="false">http://usernamedenied.wordpress.com/?p=49#comment-42</guid>
		<description>care to post an updated example?</description>
		<content:encoded><![CDATA[<p>care to post an updated example?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: usernamedenied</title>
		<link>http://usernamedenied.wordpress.com/2008/06/23/page-navigation-include-through-get-variable/#comment-37</link>
		<dc:creator>usernamedenied</dc:creator>
		<pubDate>Fri, 20 Feb 2009 15:11:18 +0000</pubDate>
		<guid isPermaLink="false">http://usernamedenied.wordpress.com/?p=49#comment-37</guid>
		<description>Parkinm, thanks ;) I have evolved my skills quite a bit. This example makes me laugh ;) Thanks</description>
		<content:encoded><![CDATA[<p>Parkinm, thanks <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  I have evolved my skills quite a bit. This example makes me laugh <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  Thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: parkinm</title>
		<link>http://usernamedenied.wordpress.com/2008/06/23/page-navigation-include-through-get-variable/#comment-36</link>
		<dc:creator>parkinm</dc:creator>
		<pubDate>Thu, 19 Feb 2009 23:20:36 +0000</pubDate>
		<guid isPermaLink="false">http://usernamedenied.wordpress.com/?p=49#comment-36</guid>
		<description>no need for you to do the str replace in this example, and it isnt worth checking file_exist either (because if you added it to safe array it must exist right? ;) )

however you should be checking that the get variable exists before you index it! :)

so I would say the code is:

if ( ! isset($_GET[&#039;page&#039;]) and ! in_array($_GET[&#039;page&#039;], $allowed))
{
     die;
}

include $_GET[&#039;page&#039;];</description>
		<content:encoded><![CDATA[<p>no need for you to do the str replace in this example, and it isnt worth checking file_exist either (because if you added it to safe array it must exist right? <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  )</p>
<p>however you should be checking that the get variable exists before you index it! <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>so I would say the code is:</p>
<p>if ( ! isset($_GET['page']) and ! in_array($_GET['page'], $allowed))<br />
{<br />
     die;<br />
}</p>
<p>include $_GET['page'];</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: usernamedenied</title>
		<link>http://usernamedenied.wordpress.com/2008/06/23/page-navigation-include-through-get-variable/#comment-34</link>
		<dc:creator>usernamedenied</dc:creator>
		<pubDate>Thu, 04 Dec 2008 21:35:44 +0000</pubDate>
		<guid isPermaLink="false">http://usernamedenied.wordpress.com/?p=49#comment-34</guid>
		<description>^_^ Don&#039;t worry, I think most of us learnt it the hard way. Error is human.. Anyone got more bad experiences?</description>
		<content:encoded><![CDATA[<p>^_^ Don&#8217;t worry, I think most of us learnt it the hard way. Error is human.. Anyone got more bad experiences?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dave</title>
		<link>http://usernamedenied.wordpress.com/2008/06/23/page-navigation-include-through-get-variable/#comment-30</link>
		<dc:creator>Dave</dc:creator>
		<pubDate>Sat, 20 Sep 2008 11:17:20 +0000</pubDate>
		<guid isPermaLink="false">http://usernamedenied.wordpress.com/?p=49#comment-30</guid>
		<description>Great article. I had this problem with some sites I built before - and I didn&#039;t take the time to sanitize (I KNOW I KNOW!). I&#039;ve had to learn the hard way. Instead of including files, one of my clients has a backend system where they can modify each page - so the request pulls up a database entry rather than a page - but this worked out for that just the same. I just pulled every page in the DB and only authorize those. I also put in a little &quot;unauthorized_requests&quot; log for logging whenever someone is tampering or just stumbles on the wrong page. :P Great site!</description>
		<content:encoded><![CDATA[<p>Great article. I had this problem with some sites I built before &#8211; and I didn&#8217;t take the time to sanitize (I KNOW I KNOW!). I&#8217;ve had to learn the hard way. Instead of including files, one of my clients has a backend system where they can modify each page &#8211; so the request pulls up a database entry rather than a page &#8211; but this worked out for that just the same. I just pulled every page in the DB and only authorize those. I also put in a little &#8220;unauthorized_requests&#8221; log for logging whenever someone is tampering or just stumbles on the wrong page. <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' />  Great site!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bert</title>
		<link>http://usernamedenied.wordpress.com/2008/06/23/page-navigation-include-through-get-variable/#comment-23</link>
		<dc:creator>Bert</dc:creator>
		<pubDate>Sun, 31 Aug 2008 15:58:46 +0000</pubDate>
		<guid isPermaLink="false">http://usernamedenied.wordpress.com/?p=49#comment-23</guid>
		<description>Jolly good show of spelling out an important concept.</description>
		<content:encoded><![CDATA[<p>Jolly good show of spelling out an important concept.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
