PhpDig.net

Go Back   PhpDig.net > PhpDig Forums > Bug Tracker

Reply
 
Thread Tools
Old 12-09-2003, 03:42 AM   #1
renehaentjens
Orange Mole
 
Join Date: Nov 2003
Posts: 69
Tiny unimportant bug with urldecode

In search_function.php (1.6.5) there is an urldecode in lines 80 and 90. I'm almost sure that these should be taken out. The web server does the urldecode for you...

The calls are harmless in 99.999% of the cases, but it is possible to construct a very artificial example where things go wrong.

You need a site where pages can contain words that contain two hex digits, for example 'E9X1', 'E9X2' etc.

Then, when you search with a query_string = % E 9 X (words begin) and find more hits than fit on one page, the first page of search results is OK (% is ignored as word separator) but you'll loose the rest when navigating to the second page of the search results.
__________________
René Haentjens, Ghent University
renehaentjens is offline   Reply With Quote
Old 12-10-2003, 08:31 AM   #2
Charter
Head Mole
 
Charter's Avatar
 
Join Date: May 2003
Posts: 2,539
Hi. Can you give a link to the page containing hex digits and a link to the search page?
__________________
Responses are offered on a voluntary if/as time is available basis, no guarantees. Double posting or bumping threads will not get your question answered any faster. No support via PM or email, responses not guaranteed. Thank you for your comprehension.
Charter is offline   Reply With Quote
Old 12-10-2003, 11:26 PM   #3
renehaentjens
Orange Mole
 
Join Date: Nov 2003
Posts: 69
Here's the complete site

Here's the complete site. Just index it, search for "p f x - % E 9 X" (words begin) and navigate to the second page of search results to find them gone.

Quote:
<?php
if ($link = (get_magic_quotes_gpc()) ?
stripslashes($_GET['link']) : $_GET['link'])
// no (raw)urldecode needed here, that is automatically done for you
{
echo '<h1>', htmlspecialchars($link), '</h1>';

// mysql_query("SELECT `url` FROM `link_table` WHERE `link`='" .
// addslashes($link) . "'");
}
else
{
echo '<h1>Links</h1><ul>';
foreach (array("pfx-Apo'strophe", 'pfx-Quo"te', "pfx-Back\slash",
"pfx-Greater>than", "pfx-Less<than", "pfx-Amper&sand",
"pfx-coefficiënt", "pfx-façade", "pfx-tête-Ã*-tête",
"pfx-%E9-01", "pfx-%E9-02", "pfx-%E9-03", "pfx-%E9-04",
"pfx-%E9-05", "pfx-%E9-06", "pfx-%E9-07", "pfx-%E9-08",
"pfx-%E9-09", "pfx-%E9-10", "pfx-%E9-11", "pfx-%E9-12",
"pfx-S p a c e")
as $link)
{
echo '<li><a href="site.php?link=' . rawurlencode($link) . '">' .
htmlspecialchars($link) . '</a></li>';
}
echo '</ul>';
}
?>
__________________
René Haentjens, Ghent University
renehaentjens is offline   Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Do i need help or is it a bug? se7en Troubleshooting 2 03-16-2006 06:23 AM
IE bug? FaberFedor Troubleshooting 6 01-30-2005 03:39 PM
Bug with PHPDIG_SESSID_VAR? Edomondo Bug Tracker 1 11-30-2004 08:56 AM
Not really a bug cybercox Mod Requests 0 04-04-2004 06:03 AM
bug... shadow00 Troubleshooting 2 12-16-2003 12:01 PM


All times are GMT -8. The time now is 03:13 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright © 2001 - 2005, ThinkDing LLC. All Rights Reserved.