problems with escaping in 1.5.5

In this board you can talk about general questions about phpMyFAQ

Moderator: Thorsten

Post Reply
jazcyk
Posts: 385
Joined: Wed Sep 07, 2005 1:32 pm

problems with escaping in 1.5.5

Post by jazcyk »

After upgrading to 1.5.5 I experience that MySQL escape charcter is not 'respected'. this FAQ http://www.webyog.com/faq/28_73_en.html

now reads:
Note: There is no 'parsing' for escape characters in the settings dialogue. That means that you must enter appropriate escape-characters here yourself. Some important aspects of this: 1) To use the standard MySQL escape character backslash (" \\ ") you must enter " \\\\ ". 2) When using the singlequote character as delimiter when importing strings that have the singlequote character in it itself the enclose character must be specified as " \\' " 3) you must use the platform-independent C-syntax notation (that also MySQL uses) for "linefeed" ( \\n ), "cariage return" ( \\r ) and "tab" ( \\t ) - unless you have changed the escape character!

with 1.5.4 it read (as it should)
Note: There is no 'parsing' for escape characters in the settings dialogue. That means that you must enter appropriate escape-characters here yourself. Some important aspects of this: 1) To use the standard MySQL escape character backslash (" \ ") you must enter " \\ ". 2) When using the singlequote character as delimiter when importing strings that have the singlequote character in it itself the enclose character must be specified as " \' " 3) you must use the platform-independent C-syntax notation (that also MySQL uses) for "linefeed" ( \n ), "cariage return" ( \r ) and "tab" ( \t ) - unless you have changed the escape character!

What happens?
jazcyk
Posts: 385
Joined: Wed Sep 07, 2005 1:32 pm

data in database changed now ..

Post by jazcyk »

so you won't see the error in the FAQ anymore.
Thorsten
Posts: 15565
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Post by Thorsten »

Hi,

we corrected the backslash-handluing in 1.5.5. Your example is right now or what do you mean?

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
matteo
Posts: 572
Joined: Sun Nov 20, 2005 6:53 pm
Location: Italy

Re: data in database changed now ..

Post by matteo »

jazcyk wrote:so you won't see the error in the FAQ anymore.
Sorry but I'm not sure to have correctly understood your question: have you performed the update stage (I mean: http://<your_complete_vhost>/install/update.php. selecting your starting PMF version, i.e., 1.5.4. Please backup your DB before starting it!) upon your PMF 1.5.5?
phpMyFAQ QA / Developer
Amazon.co.uk Wishlist
jazcyk
Posts: 385
Joined: Wed Sep 07, 2005 1:32 pm

yes I did

Post by jazcyk »

yes I did run the update script!

I might be OK now. Before the update the database contained 'double backslashes' "\\", where it should be a single one (however it was displyed correctly as one by PMF). I maually removed the redundant one from the base and it is now displayed correctly by PMF 1.5.5.

I don't remember historical details, but I may have entered the data in HTML-view. Could it be part of the problem?

If it works OK now when both writing to and reading from the base, it all finished! That is that it should in my opinion work like
1) when I enter '\' (from WySIWYG or HTML-view)
2) php-code sends '\\' to MySQL
3) then MySQL strips down to '\' before saving to the base.

You could test this tricky one:
Try save the SQL-statement
SELECT backs\\ash like '%\\\\%';
And see what it ends up like and what PMF actually sends to MySQL!
NB: this is (now - after being edited!) a correct MySQL statement that returns 'true' - because the '\' character is contained in 'backs\ash' !!
Last edited by jazcyk on Tue Dec 20, 2005 10:30 pm, edited 1 time in total.
Thorsten
Posts: 15565
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Post by Thorsten »

Hi,

okay... :-)

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
Post Reply