1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2024-11-29 02:02:40 +01:00
phorge-arcanist/src/utils
Andre Klapper ef73b12b58 Fix "strpos(): Non-string needles will be interpreted as strings" in PhutilSortVector
Summary:
Code checking if the needle string `$value` is somewhere in the haystack `"\0"` makes no sense for a single byte (if it did, then `strcmp` instead of `strpos` should have been used) and the created exception output implies that it's supposed to check that a string does not contain NULL bytes.
Thus switch the order of arguments passed to `strpos()` to be correct.

```
EXCEPTION: (RuntimeException) strpos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior at [<arcanist>/src/error/PhutilErrorHandler.php:261]
  #0 <#2> PhutilErrorHandler::handleError(integer, string, string, integer, array) called at [<arcanist>/src/error/PhutilErrorHandler.php:261]
  #1 <#2> strpos(string, integer) called at [<arcanist>/src/utils/PhutilSortVector.php:33]
```

Closes T15755

Test Plan: Read the surrounding code carefully.

Reviewers: O1 Blessed Committers, valerio.bozzolan, speck

Reviewed By: O1 Blessed Committers, valerio.bozzolan, speck

Subscribers: tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Maniphest Tasks: T15755

Differential Revision: https://we.phorge.it/D25557
2024-03-22 13:34:55 +01:00
..
__tests__ Update PhutilCowsay.php to work for small cows 2023-11-14 15:05:33 +00:00
AbstractDirectedGraph.php Remove final from private functions for PHP 8 compatibility 2021-01-10 22:05:20 +00:00
ArcanistNonblockingGuard.php Avoid leaving stdin in nonblocking mode after a modern prompt 2021-05-30 01:33:15 -07:00
CaseInsensitiveArray.php Fully merge "libphutil/" into "arcanist/" 2020-02-12 15:17:38 -08:00
PhutilArray.php Provide additional Arcanist PHP 8.1 fixes 2021-12-09 16:42:19 -08:00
PhutilArrayCheck.php Allow PhutilArrayCheck to accept a list of objects as a context 2020-05-30 03:37:42 -07:00
PhutilArrayWithDefaultValue.php Fully merge "libphutil/" into "arcanist/" 2020-02-12 15:17:38 -08:00
PhutilBufferedIterator.php Fully merge "libphutil/" into "arcanist/" 2020-02-12 15:17:38 -08:00
PhutilCallbackFilterIterator.php Provide additional Arcanist PHP 8.1 fixes 2021-12-09 16:42:19 -08:00
PhutilChunkedIterator.php Fully merge "libphutil/" into "arcanist/" 2020-02-12 15:17:38 -08:00
PhutilCowsay.php Update PhutilCowsay.php to work for small cows 2023-11-14 15:05:33 +00:00
PhutilDirectedScalarGraph.php Fully merge "libphutil/" into "arcanist/" 2020-02-12 15:17:38 -08:00
PhutilEditDistanceMatrix.php Fully merge "libphutil/" into "arcanist/" 2020-02-12 15:17:38 -08:00
PhutilExampleBufferedIterator.php Fully merge "libphutil/" into "arcanist/" 2020-02-12 15:17:38 -08:00
PhutilExecutionEnvironment.php Merge utility/support changes from "wilds" to "master" 2020-02-13 14:10:09 -08:00
PhutilHashingIterator.php Fully merge "libphutil/" into "arcanist/" 2020-02-12 15:17:38 -08:00
PhutilLunarPhase.php Fully merge "libphutil/" into "arcanist/" 2020-02-12 15:17:38 -08:00
PhutilProxyIterator.php Fully merge "libphutil/" into "arcanist/" 2020-02-12 15:17:38 -08:00
PhutilRope.php Fully merge "libphutil/" into "arcanist/" 2020-02-12 15:17:38 -08:00
PhutilSortVector.php Fix "strpos(): Non-string needles will be interpreted as strings" in PhutilSortVector 2024-03-22 13:34:55 +01:00
PhutilStreamIterator.php Fully merge "libphutil/" into "arcanist/" 2020-02-12 15:17:38 -08:00
PhutilSystem.php Return STDIN, STDOUT, and STDERR file descriptors from parent process 2022-05-05 10:27:22 -07:00
PhutilUTF8StringTruncator.php Fully merge "libphutil/" into "arcanist/" 2020-02-12 15:17:38 -08:00
utf8.php Fix PHP 8.0 ValueError calling mb_convert_encoding() with an invalid encoding 2023-07-29 12:20:40 +03:00
utils.php phutil_nonempty_scalar(): don't throw when receiving a boolean scalar 2023-07-18 12:41:43 +02:00
viewutils.php Remove all product name literals in "pht()" in Arcanist 2022-04-25 12:21:31 -07:00