Closed plison closed 9 years ago
I just tested with a fresh Starterkit, and can't reproduce the issue. Perhaps something with Magic Quotes in your PHP config?
Yes I had a closer look at it, and the problem was indeed with the Magic Quotes. Thanks for the tip! My hosting server (I use shared hosting from my university) has indeed turned on the Magic Quotes flag, and does not allow us to change this setting via .htaccess (I get a 500 error in that case).
But I found a solution, in case anyone runs into the same problem: I inserted this code in the site/config.php, and it is now working:
if (get_magic_quotes_gpc()) {
$process = array(&$_GET, &$_POST, &$_COOKIE, &$_REQUEST);
while (list($key, $val) = each($process)) {
foreach ($val as $k => $v) {
unset($process[$key][$k]);
if (is_array($v)) {
$process[$key][stripslashes($k)] = $v;
$process[] = &$process[$key][stripslashes($k)];
} else {
$process[$key][stripslashes($k)] = stripslashes($v);
}
}
}
unset($process);
}
Nice tip! Thanks for sharing. It think it would be useful if you wrote it in the Kirby forum for future reference, in the "Solutions" category: http://forum.getkirby.com/c/solutions
The text areas in the panel do not seem to handle quotes (both single and double) properly. When saving a text containing quotes, such as this is a "test"
the panel automatically escapes the quotes with a backslash, ie. the text becomes this is a \"test\"
However, the backslashes used for the escape are treated as normal characters once the text is saved, which means that the text now contains the backslashes (which will themselves be escaped after saving the text). Here is an example:
1) step 1 - before saving:
2) step 2 - after saving:
3) step 3: after saving a second time:
etc.