![]() |
|
Welcome to the Computer Webmaster Gaming Console Graphics Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact contact us. |
| |||||||
| Pear Pear programming, this is a very complex subject as with using pear with php can be a difficult task for some, so lets talk pear. |
![]() |
| | LinkBack | Thread Tools | Display Modes |
| | #1 | ||
| quipo Sat May 19 16:41:56 2007 UTC Modified files: /pear/MDB2/MDB2/Driver mysql.php mysqli.php Log: fixed bug #11055: Using placeholders with := variable assignment fails [bekarau] http://cvs.php.net/viewvc.cgi/pear/M...&diff_format=u Index: pear/MDB2/MDB2/Driver/mysql.php diff -u pear/MDB2/MDB2/Driver/mysql.php:1.184 pear/MDB2/MDB2/Driver/mysql.php:1.185 --- pear/MDB2/MDB2/Driver/mysql.php:1.184 Wed May 9 04:03:33 2007 +++ pear/MDB2/MDB2/Driver/mysql.php Sat May 19 16:41:55 2007 @@ -43,7 +43,7 @@ // | Author: Lukas Smith <smith@pooteeweet.org> | // +----------------------------------------------------------------------+ // -// $Id: mysql.php,v 1.184 2007/05/09 04:03:33 davidc Exp $ +// $Id: mysql.php,v 1.185 2007/05/19 16:41:55 quipo Exp $ // /** @@ -802,7 +802,7 @@ } $pos = strlen($query) - strlen(substr($query, $position)) - $found - 1; $substring = substr($query, $pos, $position - $pos + 2); - if (preg_match('/^@\w+:=$/', $substring)) { + if (preg_match('/^@\w+\s*:=$/', $substring)) { return $position + 1; //found an user defined variable: skip it } return $position; @@ -881,18 +881,19 @@ continue; //evaluate again starting from the new position } + //make sure this is not part of an user defined variable + $new_pos = $this->_skipUserDefinedVariable($query, $position); + if ($new_pos != $position) { + $position = $new_pos; + continue; //evaluate again starting from the new position + } + if ($query[$position] == $placeholder_type_guess) { if (is_null($placeholder_type)) { $placeholder_type = $query[$p_position]; $question = $colon = $placeholder_type; } if ($placeholder_type == ':') { - //make sure this is not part of an user defined variable - $new_pos = $this->_skipUserDefinedVariable($query, $position); - if ($new_pos != $position) { - $position = $new_pos; - continue; //evaluate again starting from the new position - } $parameter = preg_replace('/^.{'.($position+1).'}([a-z0-9_]+).*$/si', '\\1', $query); if ($parameter === '') { $err =& $this->raiseError(MDB2_ERROR_SYNTAX, null, null, @@ -1476,4 +1477,4 @@ return $result; } } -?> +?> \ No newline at end of file http://cvs.php.net/viewvc.cgi/pear/M...&diff_format=u Index: pear/MDB2/MDB2/Driver/mysqli.php diff -u pear/MDB2/MDB2/Driver/mysqli.php:1.164 pear/MDB2/MDB2/Driver/mysqli.php:1.165 --- pear/MDB2/MDB2/Driver/mysqli.php:1.164 Wed May 9 04:03:33 2007 +++ pear/MDB2/MDB2/Driver/mysqli.php Sat May 19 16:41:55 2007 @@ -43,7 +43,7 @@ // | Author: Lukas Smith <smith@pooteeweet.org> | // +----------------------------------------------------------------------+ // -// $Id: mysqli.php,v 1.164 2007/05/09 04:03:33 davidc Exp $ +// $Id: mysqli.php,v 1.165 2007/05/19 16:41:55 quipo Exp $ // /** @@ -806,7 +806,7 @@ } $pos = strlen($query) - strlen(substr($query, $position)) - $found - 1; $substring = substr($query, $pos, $position - $pos + 2); - if (preg_match('/^@\w+:=$/', $substring)) { + if (preg_match('/^@\w+\s*:=$/', $substring)) { return $position + 1; //found an user defined variable: skip it } return $position; @@ -885,18 +885,19 @@ continue; //evaluate again starting from the new position } + //make sure this is not part of an user defined variable + $new_pos = $this->_skipUserDefinedVariable($query, $position); + if ($new_pos != $position) { + $position = $new_pos; + continue; //evaluate again starting from the new position + } + if ($query[$position] == $placeholder_type_guess) { if (is_null($placeholder_type)) { $placeholder_type = $query[$p_position]; $question = $colon = $placeholder_type; } if ($placeholder_type == ':') { - //make sure this is not part of an user defined variable - $new_pos = $this->_skipUserDefinedVariable($query, $position); - if ($new_pos != $position) { - $position = $new_pos; - continue; //evaluate again starting from the new position - } $parameter = preg_replace('/^.{'.($position+1).'}([a-z0-9_]+).*$/si', '\\1', $query); if ($parameter === '') { $err =& $this->raiseError(MDB2_ERROR_SYNTAX, null, null, @@ -1628,4 +1629,4 @@ return $result; } } -?> +?> \ No newline at end of file | |||
| Featured Websites | ||||
|
![]() |
| Tags: cvs, mdb2mdb2driver, mysqliphp, mysqlphp, pear |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| cvs: pear /MDB2 package_oci8.php /MDB2/MDB2/Driver/Reverse oci8.php | Lorenzo Alberton | Pear | 0 | 05-20-2007 7:42 PM |
| cvs: pear /MDB2 package_mssql.php /MDB2/MDB2/Driver/Reverse mssql.php | Lorenzo Alberton | Pear | 0 | 05-20-2007 7:42 PM |
| cvs: pear /MDB2_Schema/MDB2 Schema.php /MDB2_Schema/MDB2/Schema Parser.php /MDB2_Schema/docs xml_schema_documentation.html | Igor Feghali | Pear | 0 | 05-20-2007 7:41 PM |
| cvs: pear /MDB2/MDB2/Driver mysql.php mysqli.php pgsql.php | David Coallier | Pear | 0 | 05-20-2007 7:41 PM |
| [PEAR] Possible serious memory leak in MDB2 | Lorenzo Alberton | Pear | 1 | 05-20-2007 6:34 PM |
| Featured Websites | ||||
|