From: eric at sharecorp dot com
Operating system: Linux
PHP version: 5.2.12
PHP Bug Type: Strings related
Bug description: No escape function escapes properly
Description:
------------
None of the escaping functions are able to properly handle style
quotes, which are produced by default by open office. Functions that I
have tested include mysql_real_escape_string, htmlentities, addslashes and
addcslashes. This behavior causes text insertion into mysql to fail as it
interprets these quotes as normal double quotes.
Reproduce code:
---------------
$title = $_POST['title'];
$date = $_POST['date'];
$tagline = $_POST['tagline'];
$article =nl2br(htmlentities($_POST['article'],ENT_QUOTES));
//<snip of some file handling>
$query = "INSERT INTO news (title, date, tagline, article, image,
image_orig) VALUES ('$title', '$date', '$tagline', '$article',
'$image',$image_orig')"
Expected result:
----------------
The should be caught, escaped properly and not affecting the query. In
this case $article was the varible containing the quotes in question.
Actual result:
--------------
All text after the opening quote is dropped from the data inserted into
the query.
--
Edit bug report at http://bugs.php.net/?id=50743&edit=1
--
Try a snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=50743&r=trysnapshot52
Try a snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=50743&r=trysnapshot53
Try a snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=50743&r=trysnapshot60
Fixed in SVN:
http://bugs.php.net/fix.php?id=50743&r=fixed
Fixed in SVN and need be documented:
http://bugs.php.net/fix.php?id=50743&r=needdocs
Fixed in release:
http://bugs.php.net/fix.php?id=50743&r=alreadyfixed
Need backtrace:
http://bugs.php.net/fix.php?id=50743&r=needtrace
Need Reproduce Script:
http://bugs.php.net/fix.php?id=50743&r=needscript
Try newer version:
http://bugs.php.net/fix.php?id=50743&r=oldversion
Not developer issue:
http://bugs.php.net/fix.php?id=50743&r=support
Expected behavior:
http://bugs.php.net/fix.php?id=50743&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=50743&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=50743&r=submittedtwice
register_globals:
http://bugs.php.net/fix.php?id=50743&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=50743&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=50743&r=dst
IIS Stability:
http://bugs.php.net/fix.php?id=50743&r=isapi
Install GNU Sed:
http://bugs.php.net/fix.php?id=50743&r=gnused
Floating point limitations:
http://bugs.php.net/fix.php?id=50743&r=float
No Zend Extensions:
http://bugs.php.net/fix.php?id=50743&r=nozend
MySQL Configuration Error:
http://bugs.php.net/fix.php?id=50743&r=mysqlcfg