From:             amal_omairi at yahoo dot com
Operating system: Windows XP Pro
PHP version:      4.3.10
PHP Bug Type:     Output Control
Bug description:  single quotes

Description:
------------
i work on a content management area system. where user text inserted to a
table in MySQL database and then reteived for preview in  atext area. but
when user types a single quote it is previewed as double quotes. the
magic_quotes_gpc is on, and magic_quotes_sybase is off. addslashes is not
used but stripslashes is used when retrieval from databse. please help. 

Reproduce code:
---------------
 <?
    include ("../../conn.php");
    include ("../../db.php");

    $table_name = "menu2_1";

      if (isset($mode))
      if (strstr($mode,"prev") != "")
            $table_name .= "_prev";

        $query = "select  *  from ".$table_name;
        $result = mysql_query($query);
    $num = mysql_num_rows($result);
    $row = mysql_fetch_row($result);
    if(!$num)
       {
            $query = "insert into  ".$table_name." (content) values
('')";
            $result = mysql_query($query);
       }
?>

....
<TD nowrap  valign=top><TEXTAREA  name="article" rows="5" 
class=textarea1><?=stripslashes($row[0])?></TEXTAREA></TD> 



Expected result:
----------------
preview single quote.

Actual result:
--------------
previwes double qoutes instead.

-- 
Edit bug report at http://bugs.php.net/?id=32230&edit=1
-- 
Try a CVS snapshot (php4):   http://bugs.php.net/fix.php?id=32230&r=trysnapshot4
Try a CVS snapshot (php5.0): 
http://bugs.php.net/fix.php?id=32230&r=trysnapshot50
Try a CVS snapshot (php5.1): 
http://bugs.php.net/fix.php?id=32230&r=trysnapshot51
Fixed in CVS:                http://bugs.php.net/fix.php?id=32230&r=fixedcvs
Fixed in release:            http://bugs.php.net/fix.php?id=32230&r=alreadyfixed
Need backtrace:              http://bugs.php.net/fix.php?id=32230&r=needtrace
Need Reproduce Script:       http://bugs.php.net/fix.php?id=32230&r=needscript
Try newer version:           http://bugs.php.net/fix.php?id=32230&r=oldversion
Not developer issue:         http://bugs.php.net/fix.php?id=32230&r=support
Expected behavior:           http://bugs.php.net/fix.php?id=32230&r=notwrong
Not enough info:             
http://bugs.php.net/fix.php?id=32230&r=notenoughinfo
Submitted twice:             
http://bugs.php.net/fix.php?id=32230&r=submittedtwice
register_globals:            http://bugs.php.net/fix.php?id=32230&r=globals
PHP 3 support discontinued:  http://bugs.php.net/fix.php?id=32230&r=php3
Daylight Savings:            http://bugs.php.net/fix.php?id=32230&r=dst
IIS Stability:               http://bugs.php.net/fix.php?id=32230&r=isapi
Install GNU Sed:             http://bugs.php.net/fix.php?id=32230&r=gnused
Floating point limitations:  http://bugs.php.net/fix.php?id=32230&r=float
No Zend Extensions:          http://bugs.php.net/fix.php?id=32230&r=nozend
MySQL Configuration Error:   http://bugs.php.net/fix.php?id=32230&r=mysqlcfg

Reply via email to