php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #58375 Not removing single/double quotes from the value
Submitted: 2008-10-11 22:40 UTC Modified: 2009-03-03 20:31 UTC
From: np at yourserveradmin dot com Assigned:
Status: Closed Package: htscanner (PECL)
PHP Version: 5.2.5 OS: GNU/Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
27 - 11 = ?
Subscribe to this entry?

 
 [2008-10-11 22:40 UTC] np at yourserveradmin dot com
Description:
------------
If an ini value is quoted with ' or "  - they are not removed.

Reproduce code:
---------------
Simply:
php_value memory_limit "32M"

which makes PHP crazy (mem limit is 0, any mallocs fail etc)

The patch:
--- a/htscanner.c
+++ b/htscanner.c
@@ -133,6 +133,17 @@ static void value_hnd(char *string, int flag, int status, HashTable *ini_entries
                        }
                }

+               if (len > 1) {
+                       if (*value == '"' || *value == '\'') {
+                               if (*value == value[len - 1]) {
+                                       value[len - 1] = 0;
+                                       len--;
+                               }
+                               value++;
+                               len--;
+                       }
+               }
+
 #define _CHECK_PATH(var, var_len, ini) php_htscanner_ini_check_path(var, var_len, ini, sizeof(ini))

                /* safe_mode & basedir check */


Expected result:
----------------
just:
32M



Actual result:
--------------
actually:
"32M"

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-03-03 20:31 UTC] pierre dot php at gmail dot com
This bug has been fixed in CVS.

In case this was a documentation problem, the fix will show up at the
end of next Sunday (CET) on pecl.php.net.

In case this was a pecl.php.net website problem, the change will show
up on the website in short time.
 
Thank you for the report, and for helping us make PECL better.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 15:01:29 2024 UTC