mirror of
https://we.phorge.it/source/arcanist.git
synced 2024-11-09 16:32:39 +01:00
Fix PHP 8.1 "strlen(null)" exception which blocks creating a project with an empty Description field
Summary: `strlen()` was used in Phabricator to check if a generic value is a non-empty string. This behavior is deprecated since PHP 8.1. Phorge adopts `phutil_nonempty_stringlike()` as a replacement for string-alike variables. Note: this may highlight other absurd input values that might be worth correcting instead of just ignoring. If phutil_nonempty_stringlike() throws an exception in your instance, report it to Phorge to evaluate and fix that specific corner case. Closes first half of T15331 Test Plan: Applied these two changes (one in Arcanist, one in Phorge). Project with empty Description field was created and `/project/view/projectid/` rendered in web browser. Reviewers: O1 Blessed Committers, valerio.bozzolan, speck Reviewed By: O1 Blessed Committers, valerio.bozzolan, speck Subscribers: avivey, speck, tobiaswiese, valerio.bozzolan, Matthew, Cigaryno Maniphest Tasks: T15331 Differential Revision: https://we.phorge.it/D25176
This commit is contained in:
parent
b325304b6e
commit
97e1631874
1 changed files with 2 additions and 2 deletions
|
@ -900,7 +900,7 @@ function array_mergev(array $arrayv) {
|
||||||
* NOTE: This function does not treat "\r" on its own as a newline because none
|
* NOTE: This function does not treat "\r" on its own as a newline because none
|
||||||
* of SVN, Git or Mercurial do on any OS.
|
* of SVN, Git or Mercurial do on any OS.
|
||||||
*
|
*
|
||||||
* @param string Block of text to be split into lines.
|
* @param string|PhutilSafeHTML $corpus Block of text to be split into lines.
|
||||||
* @param bool If true, retain line endings in result strings.
|
* @param bool If true, retain line endings in result strings.
|
||||||
* @return list List of lines.
|
* @return list List of lines.
|
||||||
*
|
*
|
||||||
|
@ -908,7 +908,7 @@ function array_mergev(array $arrayv) {
|
||||||
* @phutil-external-symbol function phutil_safe_html
|
* @phutil-external-symbol function phutil_safe_html
|
||||||
*/
|
*/
|
||||||
function phutil_split_lines($corpus, $retain_endings = true) {
|
function phutil_split_lines($corpus, $retain_endings = true) {
|
||||||
if (!strlen($corpus)) {
|
if (!phutil_nonempty_stringlike($corpus)) {
|
||||||
return array('');
|
return array('');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue