spilarix Wrote:admin/edit.php line 58 :
Code:$content = stripslashes($data_edit->content);
You just have to replace by :
Code:$content = $data_edit->content;
Thank you. It works -- backslashes no longer disappear when saving a page. But backslashes still disappear on the public page. To fix this you must also change
admin/inc/theme_functions.php, line 19:
Code:
$content = stripslashes(htmlspecialchars_decode($content, ENT_QUOTES));
Code:
$content = htmlspecialchars_decode($content, ENT_QUOTES);
(Note: I've edited the previous paragraph, the bold phrase replaces what I said: "But the public page now displays double backslashes :-)", oops.)
However I think I have found a better solution. Instead of those two changes, just edit admin/changedata.php, line 97:
Code:
if(isset($_POST['post-content'])) { $content = htmlentities($_POST['post-content'], ENT_QUOTES, 'UTF-8'); }
Code:
if(isset($_POST['post-content'])) { $content = addslashes(htmlentities($_POST['post-content'], ENT_QUOTES, 'UTF-8')); }
A better fix: To make it work with both magic quotes disabled and enabled, same line could be replaced by:
Code:
if(isset($_POST['post-content'])) {
$content = htmlentities($_POST['post-content'], ENT_QUOTES, 'UTF-8');
if (get_magic_quotes_gpc()==0) { $content = addslashes($content); }
}
I'm not totally sure, but that (or something like that) could be the fix for this issue.
(I have tested on localhost/PHP 5.3.2 with magic quotes off, and on my shared hosting/PHP 5.2.12 with magic quotes on)
spilarix Wrote:However, I don't understand why you don't have the problem with Php < 5.3.
As I said, it seems it's because of magic quotes, which are usually -I believe- enabled by default on PHP < 5.3