mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
Merge branch 'PHP-5.5' into PHP-5.6
This commit is contained in:
commit
4ca14f681e
4 changed files with 17 additions and 57 deletions
|
@ -113,7 +113,7 @@ static void php_filter_strip(zval *value, long flags)
|
||||||
int i, c;
|
int i, c;
|
||||||
|
|
||||||
/* Optimization for if no strip flags are set */
|
/* Optimization for if no strip flags are set */
|
||||||
if (! ((flags & FILTER_FLAG_STRIP_LOW) || (flags & FILTER_FLAG_STRIP_HIGH)) ) {
|
if (!(flags & (FILTER_FLAG_STRIP_LOW | FILTER_FLAG_STRIP_HIGH | FILTER_FLAG_STRIP_BACKTICK))) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
16
ext/filter/tests/bug69202.phpt
Normal file
16
ext/filter/tests/bug69202.phpt
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
--TEST--
|
||||||
|
Bug #69202 (FILTER_FLAG_STRIP_BACKTICK ignored unless other flags are used)
|
||||||
|
--SKIPIF--
|
||||||
|
<?php if (!extension_loaded("filter")) die("skip"); ?>
|
||||||
|
--FILE--
|
||||||
|
<?php
|
||||||
|
var_dump(filter_var("``a`b`c``", FILTER_SANITIZE_STRING, FILTER_FLAG_STRIP_BACKTICK));
|
||||||
|
var_dump(filter_var("``a`b`c``", FILTER_SANITIZE_STRING, FILTER_FLAG_STRIP_LOW | FILTER_FLAG_STRIP_BACKTICK));
|
||||||
|
var_dump(filter_var("``a`b`c``", FILTER_SANITIZE_STRING, FILTER_FLAG_STRIP_HIGH | FILTER_FLAG_STRIP_BACKTICK));
|
||||||
|
var_dump(filter_var("``a`b`c``", FILTER_SANITIZE_STRING, FILTER_FLAG_STRIP_LOW | FILTER_FLAG_STRIP_HIGH));
|
||||||
|
?>
|
||||||
|
--EXPECT--
|
||||||
|
string(3) "abc"
|
||||||
|
string(3) "abc"
|
||||||
|
string(3) "abc"
|
||||||
|
string(9) "``a`b`c``"
|
|
@ -313,7 +313,6 @@ extern PHPAPI zend_class_entry *spl_ce_RuntimeException;
|
||||||
mysqli_object *intern = (mysqli_object *)zend_object_store_get_object(*(__id) TSRMLS_CC);\
|
mysqli_object *intern = (mysqli_object *)zend_object_store_get_object(*(__id) TSRMLS_CC);\
|
||||||
efree(intern->ptr); \
|
efree(intern->ptr); \
|
||||||
intern->ptr = NULL; \
|
intern->ptr = NULL; \
|
||||||
ZVAL_NULL(*__id); \
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,55 +0,0 @@
|
||||||
--TEST--
|
|
||||||
mysqli_free_resource() - resets the zval to NULL
|
|
||||||
--SKIPIF--
|
|
||||||
<?php
|
|
||||||
require_once('skipif.inc');
|
|
||||||
require_once('skipifemb.inc');
|
|
||||||
require_once('skipifconnectfailure.inc');
|
|
||||||
?>
|
|
||||||
--FILE--
|
|
||||||
<?php
|
|
||||||
require('connect.inc');
|
|
||||||
if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)) {
|
|
||||||
printf("[001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error());
|
|
||||||
die();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!($res = mysqli_query($link, "SELECT 1"))) {
|
|
||||||
printf("[002] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
|
||||||
die();
|
|
||||||
}
|
|
||||||
|
|
||||||
$row = mysqli_fetch_row($res);
|
|
||||||
var_dump($row);
|
|
||||||
var_dump($res);
|
|
||||||
|
|
||||||
mysqli_free_result($res);
|
|
||||||
|
|
||||||
var_dump($row);
|
|
||||||
var_dump($res);
|
|
||||||
?>
|
|
||||||
--EXPECTF--
|
|
||||||
array(1) {
|
|
||||||
[0]=>
|
|
||||||
string(1) "1"
|
|
||||||
}
|
|
||||||
object(mysqli_result)#3 (5) {
|
|
||||||
["current_field"]=>
|
|
||||||
int(0)
|
|
||||||
["field_count"]=>
|
|
||||||
int(1)
|
|
||||||
["lengths"]=>
|
|
||||||
array(1) {
|
|
||||||
[0]=>
|
|
||||||
int(1)
|
|
||||||
}
|
|
||||||
["num_rows"]=>
|
|
||||||
int(1)
|
|
||||||
["type"]=>
|
|
||||||
int(0)
|
|
||||||
}
|
|
||||||
array(1) {
|
|
||||||
[0]=>
|
|
||||||
string(1) "1"
|
|
||||||
}
|
|
||||||
NULL
|
|
Loading…
Add table
Add a link
Reference in a new issue