Bug Fix in DB IO with parameter detection with <>

This commit is contained in:
Clemens Schwaighofer
2023-11-29 10:50:25 +09:00
parent 62ce863f2c
commit a1614bace2
5 changed files with 7 additions and 7 deletions

View File

@@ -3,7 +3,7 @@
<phar name="phpunit" version="^9.6" installed="9.6.13" location="./tools/phpunit" copy="false"/>
<phar name="phpcs" version="^3.7.2" installed="3.7.2" location="./tools/phpcs" copy="false"/>
<phar name="phpcbf" version="^3.7.2" installed="3.7.2" location="./tools/phpcbf" copy="false"/>
<phar name="psalm" version="^5.15.0" installed="5.15.0" location="./tools/psalm" copy="false"/>
<phar name="phpstan" version="^1.10.37" installed="1.10.40" location="./tools/phpstan" copy="false"/>
<phar name="psalm" version="^5.15.0" installed="5.16.0" location="./tools/psalm" copy="false"/>
<phar name="phpstan" version="^1.10.37" installed="1.10.46" location="./tools/phpstan" copy="false"/>
<phar name="phan" version="^5.4.2" installed="5.4.2" location="./tools/phan" copy="false"/>
</phive>

View File

@@ -385,7 +385,7 @@ class DateTime
} else {
$str = implode(', ', array_slice($formatted, 0, -1));
if (!empty($formatted[count($formatted) - 1])) {
$str .= ' and ' . $formatted[count($formatted) - 1];
$str .= ' and ' . (string)array_pop($formatted);
}
return $negative . $str;
}

View File

@@ -1318,14 +1318,14 @@ class IO
// regex for params: only stand alone $number allowed
// exclude all '' enclosed strings, ignore all numbers [note must start with digit]
// can have space/tab/new line
// must have = , ( [equal, comma, opening round bracket]
// must have <> = , ( [not equal, equal, comma, opening round bracket]
// can have space/tab/new line
// $ number with 1-9 for first and 0-9 for further digits
// /s for matching new line in . list
// [disabled, we don't used ^ or $] /m for multi line match
// Matches in 1:, must be array_filtered to remove empty, count with array_unique
preg_match_all(
'/(?:\'.*?\')?\s*(?:\?\?|[(=,])\s*(?:\d+|(?:\'.*?\')|(\$[1-9]{1}(?:[0-9]{1,})?))/s',
'/(?:\'.*?\')?\s*(?:\?\?|<>|[(=,])\s*(?:\d+|(?:\'.*?\')|(\$[1-9]{1}(?:[0-9]{1,})?))/s',
$query,
$match
);

View File

@@ -1 +1 @@
/home/clemens/.phive/phars/phpstan-1.10.40.phar
/home/clemens/.phive/phars/phpstan-1.10.46.phar

View File

@@ -1 +1 @@
/home/clemens/.phive/phars/psalm-5.15.0.phar
/home/clemens/.phive/phars/psalm-5.16.0.phar