Bug #75755 [NEW]: MySQLi MUST provide an escape function for use in MATCH...AGAINST
| From: | php4fan at gmail dot com | Date: | Wed, 03 Jan 2018 16:41:13 +0000 |
| Subject: | Bug #75755 [NEW]: MySQLi MUST provide an escape function for use in MATCH...AGAINST | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-213363@lists.php.net to get a copy of this message | ||
From: php4fan at gmail dot com
Operating system:
PHP version: 5.6.32
Package: MySQLi related
Bug Type: Bug
Bug description:MySQLi MUST provide an escape function for use in MATCH...AGAINST
Description:
------------
Say you have a string $someword and you need to use it within a query
like:
"SELECT whatever where MATCH(whatever) AGAINST('+$someword
+someotherword' IN BOOLEAN MODE)"
You need to properly escape certain characters in $someword so that you
don't get syntax errors in the boolean search expression. I know I'm
being sloppy at defining what needs to be done. Actually I'm pretty sure
there are different kinds of escaping you would need for different use
cases, but it's certainly possible to define them unambiguously.
Expected: there should be methods in the MySQLi class for this.
Observed: you have to write your own code, and you'll almost certainly
get it wrong; or you'll have to find some 3rd party libraries, which is
pathetic.
--
Edit bug report at https://bugs.php.net/bug.php?id=75755&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=75755&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=75755&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=75755&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=75755&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=75755&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=75755&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=75755&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=75755&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=75755&r=support
Expected behavior: https://bugs.php.net/fix.php?id=75755&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=75755&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=75755&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=75755&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=75755&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=75755&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=75755&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=75755&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=75755&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=75755&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=75755&r=mysqlcfg