Remove USE_UTF_STRINGS

https://github.com/phpmyadmin/sql-parser/pull/471

Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
This commit is contained in:
Kamil Tekiela 2023-06-07 23:47:43 +01:00
parent 70ff7dcd6b
commit c6ddb1e3a1
2 changed files with 2 additions and 7 deletions

View File

@ -13,11 +13,9 @@ use PhpMyAdmin\SqlParser\UtfString;
use PhpMyAdmin\SqlParser\Utils\Error as ParserError;
use function __;
use function defined;
use function htmlspecialchars;
use function mb_strlen;
use function sprintf;
use function strlen;
/**
* The linter itself.
@ -33,7 +31,7 @@ class Linter
*/
public static function getLines(string|UtfString $str): array
{
if ((! ($str instanceof UtfString)) && defined('USE_UTF_STRINGS') && USE_UTF_STRINGS) {
if ((! ($str instanceof UtfString))) {
// If the lexer uses UtfString for processing then the position will
// represent the position of the character and not the position of
// the byte.
@ -52,7 +50,7 @@ class Linter
// first byte of the third character. The fourth and the last one
// (which is actually a new line) aren't going to be processed at
// all.
$len = $str instanceof UtfString ? $str->length() : strlen($str);
$len = $str->length();
$lines = [0];
for ($i = 0; $i < $len; ++$i) {

View File

@ -7361,9 +7361,6 @@
<PossiblyNullOperand>
<code>$error[3]</code>
</PossiblyNullOperand>
<UndefinedConstant>
<code>USE_UTF_STRINGS</code>
</UndefinedConstant>
</file>
<file src="libraries/classes/ListDatabase.php">
<InvalidArrayOffset>