View Single Post

Old 06-04-2007   #3 (permalink)
Sergey Hmelevsky
Subrion Tech Support
 
Join Date: Apr 2007
Posts: 644
Sergey Hmelevsky will become famous soon enough
Default Re: problem of this character \ before ' when i have posted a Subitem

Yes, here is 2 ways:
1. Easy: ask your hosting administrator to disable magic_quotes_gpc in php.ini
or
2. A little more complicated:
a) add to file admin/util.php
PHP Code:
function clr_slash($string)
{
    if (
get_magic_quotes_gpc())
        
$string stripslashes($string);
    return 
$string;

b) in file admin/create-subitem.php find lines
PHP Code:
<input type="text" name="title" size="45" maxlength="150" value="<?php echo $_POST['title'] ? $_POST['title'] : $subitem['title']; ?>" />
--- and ---
<textarea name="body" rows="10" cols="50"><?php echo $_POST['body'] ? $_POST['body'] : $subitem['description']; ?></textarea>
and replace its in accordance
PHP Code:
<input type="text" name="title" size="45" maxlength="150" value="<?php echo $_POST clr_slash($_POST['title']) : $subitem['title']; ?>" />
--- and ---
<textarea name="body" rows="10" cols="50"><?php echo $_POST clr_slash($_POST['body']) : $subitem['description']; ?></textarea>
Sergey Hmelevsky is offline   Reply With Quote