This topic is locked

Strange query results using "\" Backslash

1/7/2010 12:08:35 AM
PHPRunner General questions
D
dblack6047 author

Greetings,
I have a very strange search/query anomaly that I detected after building my website using PHPRunner 5.1. Specifically, on the main page of my website "www.HashSets.com"; you can perform a simple query to find known files (and MD5 hashes) that are associated with Microsoft Windows.
For example, if you want to know what files are in the "C:\Windows\System32" directory you could do the following simple search:
Select "Path or Directory" from the first pull down menu then "Contains" from the second pull down menu and then put in the entry box "System32" and click the "Begin Searching" button. The query will proceed perfectly and show you all files contained within a "C:\Windows\System32" directory and subdirectories.
If you add a backslash after System32 such as "System32\" it returns no search results at all.
Why is it that the back slash causes the query to come back false? Is there a specific query rule built within PHPRunner 5.1 that refuses to present the query results using a backslash "\" ?
I have added the backslash in the front of "System32" such as "\System32" and it works fine. Just putting it at the back end of the search term causes a failed query.
I am confused totally.
Thanks in advance for any insight,
David

D
dblack6047 author 1/7/2010

One more thing...
I forgot to mention that I also tested forward slashes "/" such as those used in UNIX or Linux directory structures (i.e. /usr or usr/) and it works perfect. There is just something very odd about the use of trailing backslashes "\".
David

J
Jane 1/7/2010

David,
It's difficult to tell you what's happening without seeing actual files.
Please publish your project on Demo Account and open a ticket at http://support.xlinesoft.com sending a URL to your pages along with instructions on reproducing this error.

T
thesofa 1/7/2010

are backslashes not used like escape characters in sql queries, to allow the use of unusual characters?

D
dblack6047 author 1/8/2010

Everyone,
Jane confirmed the trailing "\" backslash query bug after reviewing my PHPRunner code. According to Jane it will be fixed with the next update of PHPRunner.
If you anticipate running into the same problem then you can do what I was advised to do which I confirmed works:
Open generated include/dbconnection.php file, find this code:

----------------------------------

function db_addslashes($str)

{

return mysql_real_escape_string($str);

}

----------------------------------

and replace it with this one:

----------------------------------

function db_addslashes($str)

{

return addslashes(mysql_real_escape_string($str));

}

----------------------------------
This will allow trailing "\" backslashes to be used within search queries.