Merge pull request #18491 from kamil-tekiela/USE_UTF_STRINGS

Remove USE_UTF_STRINGS
This commit is contained in:
Maurício Meneghini Fauth 2023-06-09 19:32:57 -03:00 committed by GitHub
commit fa8931e88c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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

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