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_string()` as a replacement.
Note: this may highlight other absurd input values that might be worth correcting
instead of just ignoring. If phutil_nonempty_string() throws an exception in your
instance, report it to Phorge to evaluate and fix that specific corner case.
Closes T15391
Test Plan:
Applied this change and afterwards, "Bulk Editor" page on `/maniphest/bulk/` rendered correctly.
To test that:
- visit a list of some Tasks (like `/maniphest/`)
- filter something (this can be done in multiple ways)
- select Tasks
- click on Bulk Edit Selected Tasks
Reviewers: O1 Blessed Committers, valerio.bozzolan
Reviewed By: O1 Blessed Committers, valerio.bozzolan
Subscribers: speck, tobiaswiese, valerio.bozzolan, Matthew, Cigaryno
Maniphest Tasks: T15391
Differential Revision: https://we.phorge.it/D25223
Summary:
This is a small fix in a specific user message example. See other messages in the very same file which also use `<tt>`.
Here the problematic phrase:
{F292970}
See the example in the phrase "Use lowercase letters, digits, and periods. For example: ...".
Test Plan: After this change, the specific message "The URI where the OAuth server is installed. For example" from the page `/auth/config/edit/?provider=PhabricatorPhabricatorAuthProvider` does not have anymore backticks shown to the end user.
Reviewers: O1 Blessed Committers, valerio.bozzolan
Reviewed By: O1 Blessed Committers, valerio.bozzolan
Subscribers: speck, tobiaswiese, valerio.bozzolan, Matthew, Cigaryno
Differential Revision: https://we.phorge.it/D25232
Summary:
Fix a specific problem when visiting some specific pages like this one:
/auth/config/edit/?provider=PhabricatorPhabricatorAuthProvider:
Regression introduced in:
562d36ef5f
Stack trace:
[Fri May 19 14:23:35.506028 2023] [php7:notice] [pid 20439] [client 127.0.0.1:39692] [2023-05-19 14:23:35] EXCEPTION: (InvalidArgumentException) Call to phutil_nonempty_string() expected null or a string, got: PhutilSafeHTML. at [<arcanist>/src/utils/utils.php:2127]
[Fri May 19 14:23:35.506647 2023] [php7:notice] [pid 20439] [client 127.0.0.1:39692] arcanist(head=arcpatch-D25049, ref.master=c14785c3795c, ref.arcpatch-D25049=1b6412c24640), phorge(head=arcpatch-D25216_1, ref.master=2df7ea13a387, ref.arcpatch-D25216_1=02b40a9e25eb)
[Fri May 19 14:23:35.506661 2023] [php7:notice] [pid 20439] [client 127.0.0.1:39692] #0 <#2> phutil_nonempty_string(PhutilSafeHTML) called at [<phorge>/src/view/form/control/AphrontFormControl.php:206]
[Fri May 19 14:23:35.506665 2023] [php7:notice] [pid 20439] [client 127.0.0.1:39692] #1 <#2> phutil_tag(string, array, array) called at [<phorge>/src/view/form/PHUIFormLayoutView.php:54]
[Fri May 19 14:23:35.506667 2023] [php7:notice] [pid 20439] [client 127.0.0.1:39692] #2 <#2> PHUIFormLayoutView::render() called at [<phorge>/src/view/form/AphrontFormView.php:160]
We keep 100% backward compatibility, reproducing the implicit cast happening automatically before PHP 8.1
It has also been simplified the non-empty check since that is possible after casting to string.
Closes T15404
Test Plan:
- Visit the page mentioned in the commit summary
- no longer explodes
- you still don't see empty Captions
- you still see populated Captions
- you still see HTML rendered for populated Captions
Reviewers: O1 Blessed Committers, avivey
Reviewed By: O1 Blessed Committers, avivey
Subscribers: avivey, speck, tobiaswiese, Matthew, Cigaryno
Maniphest Tasks: T15404
Differential Revision: https://we.phorge.it/D25231
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_string()` as a replacement.
Note: this may highlight other absurd input values that might be worth correcting
instead of just ignoring. If phutil_nonempty_string() throws an exception in your
instance, report it to Phorge to evaluate and fix that specific corner case.
Closes T15383
Test Plan:
Applied these two changes; afterwards "Username/Password" page at `/auth/config/view/1/` gets rendered in web browser.
Additional tests (you need D25231 to complete this test plan):
- Create WordPress Auth; Edit; Disable; Enable (and Disable again to cleanup)
- Create Twitter Auth; Edit; Disable; Enable (and Disable again to cleanup)
- Create Amazon Auth; Edit; Disable; Enable (and Disable again to cleanup)
- Create Asana Auth; Edit; Disable; Enable (and Disable again to cleanup)
- Create Bitbucket Auth; Edit; Disable; Enable (and Disable again to cleanup)
- Create Disqus Auth; Edit; Disable; Enable (and Disable again to cleanup)
- Create Disqus Auth; Edit; Disable Enable (and Disable again to cleanup)
- Create Facebook Auth; Edit; Disable Enable (and Disable again to cleanup)
- Create GitHub Auth; Edit; Disable Enable (and Disable again to cleanup)
- Create JIRA Auth; Edit; Disable; Enable (and Disable again to cleanup)
- Create Google Auth; Edit; Disable; Enable (and Disable again to cleanup)
- Create LDAP Auth; Edit; Disable; Enable (and Disable again to cleanup)
- Create Phorge Auth; Edit; Disable; Enable (and Disable again to cleanup)
- Create Slack Auth; Edit; Disable; Enable (and Disable again to cleanup)
- Create Twitch.tv Auth; Edit; Disable; Enable (and Disable again to cleanup)
Reviewers: O1 Blessed Committers, valerio.bozzolan
Reviewed By: O1 Blessed Committers, valerio.bozzolan
Subscribers: speck, tobiaswiese, valerio.bozzolan, Matthew, Cigaryno
Maniphest Tasks: T15383
Differential Revision: https://we.phorge.it/D25216
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_string()` as a replacement.
Note: this may highlight other absurd input values that might be worth correcting
instead of just ignoring. If phutil_nonempty_string() throws an exception in your
instance, report it to Phorge to evaluate and fix that specific corner case.
Similarly, `preg_match()` does not accept passing `null` as `$subject` parameter since PHP 8.1.
Closes T15337
Test Plan: Applied these four changes and `/diffusion/4/manage/` finally rendered in web browser.
Reviewers: O1 Blessed Committers, valerio.bozzolan
Reviewed By: O1 Blessed Committers, valerio.bozzolan
Subscribers: speck, tobiaswiese, valerio.bozzolan, Matthew, Cigaryno
Maniphest Tasks: T15337
Differential Revision: https://we.phorge.it/D25182
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_string()` as a replacement.
Note: this may highlight other absurd input values that might be worth correcting
instead of just ignoring. If phutil_nonempty_string() throws an exception in your
instance, report it to Phorge to evaluate and fix that specific corner case.
Closes T15395
Test Plan: Applied these two changes; afterwards "All Signatures" page at `/legalpad/signatures/1/` gets rendered in web browser.
Reviewers: O1 Blessed Committers, valerio.bozzolan
Reviewed By: O1 Blessed Committers, valerio.bozzolan
Subscribers: speck, tobiaswiese, valerio.bozzolan, Matthew, Cigaryno
Maniphest Tasks: T15395
Differential Revision: https://we.phorge.it/D25226
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_string()` as a replacement.
Note: this may highlight other absurd input values that might be worth correcting
instead of just ignoring. If phutil_nonempty_string() throws an exception in your
instance, report it to Phorge to evaluate and fix that specific corner case.
Closes T15382
Test Plan:
Applied this change and after performing steps to send a test message again, `/mail/detail/107/` page got rendered correctly
and I can see the "Status Details" with stuff like "//None//" or "No mailers are configured."
Reviewers: O1 Blessed Committers, valerio.bozzolan
Reviewed By: O1 Blessed Committers, valerio.bozzolan
Subscribers: speck, tobiaswiese, valerio.bozzolan, Matthew, Cigaryno
Maniphest Tasks: T15382
Differential Revision: https://we.phorge.it/D25215
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_string()` as a replacement.
Note: this may highlight other absurd input values that might be worth correcting
instead of just ignoring. If phutil_nonempty_string() throws an exception in your
instance, report it to Phorge to evaluate and fix that specific corner case.
Similarly, `explode(string $separator, string $string, int $limit)` does not accept
passing null instead of an actual string as input parameter either anymore.
Closes T15284
Test Plan: Applied these two changes. Afterwards, admin user account was created and Phorge homepage rendered in web browser on a fresh installation.
Reviewers: O1 Blessed Committers, valerio.bozzolan
Reviewed By: O1 Blessed Committers, valerio.bozzolan
Subscribers: speck, tobiaswiese, valerio.bozzolan, Matthew, Cigaryno
Maniphest Tasks: T15284
Differential Revision: https://we.phorge.it/D25175
Summary:
`strlen()` was used in Phabricator to check if a generic value is a non-empty string.
But, that function does not accept null anymore since PHP 8.1.
Closes T15396
Test Plan: Applied this change (on top of D25179 and D25226) and the "Browse Dashboards" dialog got rendered in web browser.
Reviewers: O1 Blessed Committers, valerio.bozzolan
Reviewed By: O1 Blessed Committers, valerio.bozzolan
Subscribers: speck, tobiaswiese, valerio.bozzolan, Matthew, Cigaryno
Maniphest Tasks: T15396
Differential Revision: https://we.phorge.it/D25227
Summary:
Fix a regression in this specific point:
phutil_nonempty_string(integer) called at [<phorge>/src/applications/transactions/storage/PhabricatorModularTransactionType.php:342]
This regression was causing a broken Almanac page and maybe others.
Note: The function phutil_nonempty_string() is well-known to be very angry and
throws for any alien value. This is by design, and in many cases
this is appropriate. But not here.
The business logic here handles very generic types like integers
and really probably whatever scalar value coming from an user input
and then normalized to something else, not necessarily a string, but definitely
something that can be cast to string.
If you have better ideas about how to handle these cases, please join T15190.
Closes T15385
Test Plan:
To test Almanac:
1. go to `/almanac/network/` and create at least one network (example: "foo")
2. go to `/almanac/device/` and create at least one device (example: "bar")
3. visit that Device
4. Add Interface
- test the creation of an empty Interface
- test the creation of a right Interface (example: Network "foo", Address 127.0.0.1, Port 80)
- nothing esplodes anymore
Reviewers: arnold, O1 Blessed Committers, avivey
Reviewed By: arnold, O1 Blessed Committers, avivey
Subscribers: avivey, speck, tobiaswiese, Matthew, Cigaryno
Maniphest Tasks: T15385
Differential Revision: https://we.phorge.it/D25220
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_string()` as a replacement.
Note: this may highlight other absurd input values that might be worth correcting
instead of just ignoring. If phutil_nonempty_string() throws an exception in your
instance, report it to Phorge to evaluate and fix that specific corner case.
Closes T15384
Test Plan: Applied these four changes; logged in again; logged out again; finally saw "Log In" page with "Username or Email" and "Password" field on `/auth/loggedout/` rendered in web browser.
Reviewers: O1 Blessed Committers, avivey
Reviewed By: O1 Blessed Committers, avivey
Subscribers: speck, tobiaswiese, valerio.bozzolan, Matthew, Cigaryno
Maniphest Tasks: T15384
Differential Revision: https://we.phorge.it/D25217
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_string()` as a replacement.
Note: this may highlight other absurd input values that might be worth correcting
instead of just ignoring. If phutil_nonempty_string() throws an exception in your
instance, report it to Phorge to evaluate and fix that specific corner case.
Similarly, `preg_match()` does not accept passing `null` as `$subject` parameter since PHP 8.1.
Closes T15381
Test Plan: Applied these two changes (on top of D25179 and D25213), and on the task creation page, after clicking the magnifier icon in the "Subscribers" field, the "Browse Subscribers" overlay dialog got rendered.
Reviewers: O1 Blessed Committers, valerio.bozzolan
Reviewed By: O1 Blessed Committers, valerio.bozzolan
Subscribers: speck, tobiaswiese, valerio.bozzolan, Matthew, Cigaryno
Maniphest Tasks: T15381
Differential Revision: https://we.phorge.it/D25214
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_string()` as a replacement.
Note: this may highlight other absurd input values that might be worth correcting
instead of just ignoring. If phutil_nonempty_string() throws an exception in your
instance, report it to Phorge to evaluate and fix that specific corner case.
Closes T15380
Test Plan: Applied these two changes (on top of D25179) and on the task creation page, after clicking the magnifier icon in the "Tags" field, the "Browse Projects" overlay dialog got rendered.
Reviewers: O1 Blessed Committers, valerio.bozzolan
Reviewed By: O1 Blessed Committers, valerio.bozzolan
Subscribers: speck, tobiaswiese, valerio.bozzolan, Matthew, Cigaryno
Maniphest Tasks: T15380
Differential Revision: https://we.phorge.it/D25213
Summary:
Since PHP 8.1, conversion from float to integer should be explicit.
https://wiki.php.net/rfc/implicit-float-int-deprecate
According to `phlog`, the alpha channel value of the automatically created user
avatar image for a new user account sometimes is a float.
Thus always `round()` the alpha channel value to be an integer.
Closes T15375
Test Plan: Applied this change, created five user accounts via http://phorge.localhost/people/new/standard/ , and each resulting alpha value in `PhabricatorFilesComposeAvatarBuiltinFile.php` was an integer according to `phlog` (see corresponding Maniphest task). Rendering of each new user page always succeeded.
Reviewers: O1 Blessed Committers, valerio.bozzolan
Reviewed By: O1 Blessed Committers, valerio.bozzolan
Subscribers: speck, tobiaswiese, valerio.bozzolan, Matthew, Cigaryno
Maniphest Tasks: T15375
Differential Revision: https://we.phorge.it/D25209
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_string()` as a replacement.
Note: this may highlight other absurd input values that might be worth correcting
instead of just ignoring. If phutil_nonempty_string() throws an exception in your
instance, report it to Phorge to evaluate and fix that specific corner case.
Closes T15377
Test Plan: Applied this change, afterwards repeated the steps to add a new email address on `/settings/panel/email/` and left the "Email" field empty. This time, after selecting the "Save" button, the error message "Email is required." is displayed in the "New Address" overlay dialog.
Reviewers: O1 Blessed Committers, valerio.bozzolan
Reviewed By: O1 Blessed Committers, valerio.bozzolan
Subscribers: speck, tobiaswiese, valerio.bozzolan, Matthew, Cigaryno
Maniphest Tasks: T15377
Differential Revision: https://we.phorge.it/D25211
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_string()` as a replacement.
Note: this may highlight other absurd input values that might be worth correcting
instead of just ignoring. If phutil_nonempty_string() throws an exception in your
instance, report it to Phorge to evaluate and fix that specific corner case.
Closes T15374
Test Plan: Applied these two changes, performed the user creation steps again, and afterwards the user page at `/p/user5/` finally rendered in web browser.
Reviewers: O1 Blessed Committers, valerio.bozzolan
Reviewed By: O1 Blessed Committers, valerio.bozzolan
Subscribers: speck, tobiaswiese, valerio.bozzolan, Matthew, Cigaryno
Maniphest Tasks: T15374
Differential Revision: https://we.phorge.it/D25208
Summary:
On a Workboard without any "Group by <something>", when moving a Task from a Column
to another, in PHP 8.1 there was a crash caused by a null passed to `strlen()`.
`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_string()` as a replacement.
Note: this may highlight other absurd input values that might be worth correcting
instead of just ignoring. If phutil_nonempty_string() throws an exception in your
instance, report it to Phorge to evaluate and fix that specific corner case.
Closes T15373
Test Plan:
Applied this change and afterwards dragging a Task card to another Column succeeded,
with or without a "Group by <something>" query.
Reviewers: O1 Blessed Committers, valerio.bozzolan
Reviewed By: O1 Blessed Committers, valerio.bozzolan
Subscribers: speck, tobiaswiese, valerio.bozzolan, Matthew, Cigaryno
Maniphest Tasks: T15373
Differential Revision: https://we.phorge.it/D25207
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_string()` as a replacement.
Note: this may highlight other absurd input values that might be worth correcting
instead of just ignoring. If phutil_nonempty_string() throws an exception in your
instance, report it to Phorge to evaluate and fix that specific corner case.
Closes T15362
Test Plan: Applied these two changes and `/calendar/import/edit/` correctly rendered the "Create Import" page in the web browser, with the expected error about the missing ICS file (instead of an exception stacktrace).
Reviewers: O1 Blessed Committers, valerio.bozzolan
Reviewed By: O1 Blessed Committers, valerio.bozzolan
Subscribers: speck, tobiaswiese, valerio.bozzolan, Matthew, Cigaryno
Maniphest Tasks: T15362
Differential Revision: https://we.phorge.it/D25200
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_string()` as a replacement.
Note: this may highlight other absurd input values that might be worth correcting
instead of just ignoring. If phutil_nonempty_string() throws an exception in your
instance, report it to Phorge to evaluate and fix that specific corner case.
Closes T15365
Test Plan: Applied this change and `/packages/package/edit/form/default/` and `/fund/create/` finally rendered in web browser, showing the expected error messages about not having entered any data in the creation page.
Reviewers: O1 Blessed Committers, valerio.bozzolan
Reviewed By: O1 Blessed Committers, valerio.bozzolan
Subscribers: speck, tobiaswiese, valerio.bozzolan, Matthew, Cigaryno
Maniphest Tasks: T15365
Differential Revision: https://we.phorge.it/D25202
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_string()` as a replacement.
Note: this may highlight other absurd input values that might be worth correcting
instead of just ignoring. If phutil_nonempty_string() throws an exception in your
instance, report it to Phorge to evaluate and fix that specific corner case.
Closes T15363
Test Plan: Applied this change and "Default Account" page `/phortune/account/1/details/` rendered in web browser.
Reviewers: O1 Blessed Committers, valerio.bozzolan
Reviewed By: O1 Blessed Committers, valerio.bozzolan
Subscribers: speck, tobiaswiese, valerio.bozzolan, Matthew, Cigaryno
Maniphest Tasks: T15363
Differential Revision: https://we.phorge.it/D25201
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_string()` as a replacement.
Note: this may highlight other absurd input values that might be worth correcting
instead of just ignoring. If phutil_nonempty_string() throws an exception in your
instance, report it to Phorge to evaluate and fix that specific corner case.
This is exactly the same case as D25140.
Closes T15360
Test Plan: Applied this change and `/project/view/1/` rendered the workboard in the web browser as expected.
Reviewers: O1 Blessed Committers, valerio.bozzolan
Reviewed By: O1 Blessed Committers, valerio.bozzolan
Subscribers: speck, tobiaswiese, valerio.bozzolan, Matthew, Cigaryno
Maniphest Tasks: T15360
Differential Revision: https://we.phorge.it/D25199
Summary:
Since PHP 8.1, passing a null string to `ltrim(string $string, string $characters)` is deprecated.
Thus do not check for `$path = null` but check for `$path = ''` before passing `$path` as the `$string` parameter to `ltrim()`, like src/applications/settings/panel/PhabricatorSettingsPanel.php already does.
Closes T15359
Test Plan: Applied this change (on top of D25197) and five applications' Configure pages (Differential, Maniphest, Files, Paste, and Ponder) finally rendered in web browser.
Reviewers: O1 Blessed Committers, valerio.bozzolan
Reviewed By: O1 Blessed Committers, valerio.bozzolan
Subscribers: speck, tobiaswiese, valerio.bozzolan, Matthew, Cigaryno
Maniphest Tasks: T15359
Differential Revision: https://we.phorge.it/D25198
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_string()` as a replacement.
Note: this may highlight other absurd input values that might be worth correcting
instead of just ignoring. If phutil_nonempty_string() throws an exception in your
instance, report it to Phorge to evaluate and fix that specific corner case.
Added also a small inline documentation to better leave what I find.
Closes T15358
Test Plan:
Applied this change change and way more applications' Configure pages finally rendered in web browser.
For example, `/applications/view/PhabricatorAuditApplication/` is now correctly rendered.
(However, some pages expose followup exceptions to be handled in separate tasks.)
Reviewers: O1 Blessed Committers, valerio.bozzolan
Reviewed By: O1 Blessed Committers, valerio.bozzolan
Subscribers: speck, tobiaswiese, valerio.bozzolan, Matthew, Cigaryno
Maniphest Tasks: T15358
Differential Revision: https://we.phorge.it/D25197
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_string()` as a replacement.
Note: this may highlight other absurd input values that might be worth correcting
instead of just ignoring. If phutil_nonempty_string() throws an exception in your
instance, report it to Phorge to evaluate and fix that specific corner case.
Closes T15357
Test Plan: Applied this change and created blog post at `/phame/post/view/3/blogpost/` rendered in web browser.
Reviewers: O1 Blessed Committers, valerio.bozzolan
Reviewed By: O1 Blessed Committers, valerio.bozzolan
Subscribers: speck, tobiaswiese, valerio.bozzolan, Matthew, Cigaryno
Maniphest Tasks: T15357
Differential Revision: https://we.phorge.it/D25196
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_string()` as a replacement.
Note: this may highlight other absurd input values that might be worth correcting
instead of just ignoring. If phutil_nonempty_string() throws an exception in your
instance, report it to Phorge to evaluate and fix that specific corner case.
Closes T15356
Test Plan: Applied this change change on top of D25194 and `/phame/blog/view/1/` rendered in web browser.
Reviewers: O1 Blessed Committers, valerio.bozzolan
Reviewed By: O1 Blessed Committers, valerio.bozzolan
Subscribers: speck, tobiaswiese, valerio.bozzolan, Matthew, Cigaryno
Maniphest Tasks: T15356
Differential Revision: https://we.phorge.it/D25195
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_string()` as a replacement.
Note: this may highlight other absurd input values that might be worth correcting
instead of just ignoring. If phutil_nonempty_string() throws an exception in your
instance, report it to Phorge to evaluate and fix that specific corner case.
Closes T15355
Test Plan: Applied this change and `/phame/blog/manage/3/` correctly rendered in web browser.
Reviewers: O1 Blessed Committers, valerio.bozzolan
Reviewed By: O1 Blessed Committers, valerio.bozzolan
Subscribers: speck, tobiaswiese, valerio.bozzolan, Matthew, Cigaryno
Maniphest Tasks: T15355
Differential Revision: https://we.phorge.it/D25194
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_string()` as a replacement.
Note: this may highlight other absurd input values that might be worth correcting
instead of just ignoring. If phutil_nonempty_string() throws an exception in your
instance, report it to Phorge to evaluate and fix that specific corner case.
Closes T15353
Test Plan: Applied this change and `/pholio/create/` displayed an image preview after uploading an image file.
Reviewers: O1 Blessed Committers, valerio.bozzolan
Reviewed By: O1 Blessed Committers, valerio.bozzolan
Subscribers: speck, tobiaswiese, valerio.bozzolan, Matthew, Cigaryno
Maniphest Tasks: T15353
Differential Revision: https://we.phorge.it/D25193
Summary:
This fixes this specific exception that can happen with whatever PHP version in some pages:
Call to phutil_nonempty_string() expected null or a string, got: PhutilURI from PHUIObjectItemView.php:662
The regression was introduced since:
b56d86e48d
The problem is caused by the fact that we are trying to introduce very strict checks, and sometime we are too much strict.
In this specific case we use `phutil_nonempty_stringlike()` since it also allows objects with a `__toString()` method.
In order not to leave these cases to chance, we have added a log line, which can be removed in the future.
If you see this log line, report it in the respective Task. Thank you!
Closes T15306
Ref T15316
Test Plan:
1. {nav Dashboard > Add a Panel}: no crash
2. {nav Diffusion repo > README}: no crash
3. {nav Herald > Create}: no crash
Reviewers: O1 Blessed Committers, avivey
Reviewed By: O1 Blessed Committers, avivey
Subscribers: avivey, aklapper, speck, tobiaswiese, Matthew, Cigaryno
Maniphest Tasks: T15306, T15316
Differential Revision: https://we.phorge.it/D25157
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_string()` as a replacement.
Note: this may highlight other absurd input values that might be worth correcting
instead of just ignoring. If phutil_nonempty_string() throws an exception in your
instance, report it to Phorge to evaluate and fix that specific corner case.
Closes T15342
Test Plan:
Applied these two changes on top of D25186.
Added an Alt Text to a file; page of the File now rendered correctly in web browser.
Removed Alt Text from a file; page of the File now rendered correctly in web browser.
Reviewers: O1 Blessed Committers, valerio.bozzolan
Reviewed By: O1 Blessed Committers, valerio.bozzolan
Subscribers: speck, tobiaswiese, valerio.bozzolan, Matthew, Cigaryno
Maniphest Tasks: T15342
Differential Revision: https://we.phorge.it/D25187
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_string()` as a replacement.
Note: this may highlight other absurd input values that might be worth correcting
instead of just ignoring. If phutil_nonempty_string() throws an exception in your
instance, report it to Phorge to evaluate and fix that specific corner case.
Closes T15341
Test Plan: Applied these four changes and file page at `/F91` finally rendered in web browser.
Reviewers: O1 Blessed Committers, valerio.bozzolan
Reviewed By: O1 Blessed Committers, valerio.bozzolan
Subscribers: speck, tobiaswiese, valerio.bozzolan, Matthew, Cigaryno
Maniphest Tasks: T15341
Differential Revision: https://we.phorge.it/D25186
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_string()` as a replacement.
Note: this may highlight other absurd input values that might be worth correcting
instead of just ignoring. If phutil_nonempty_string() throws an exception in your
instance, report it to Phorge to evaluate and fix that specific corner case.
Closes T15340
Test Plan: Applied this change and page `/S3` rendered in web browser.
Reviewers: O1 Blessed Committers, valerio.bozzolan
Reviewed By: O1 Blessed Committers, valerio.bozzolan
Subscribers: speck, tobiaswiese, valerio.bozzolan, Matthew, Cigaryno
Maniphest Tasks: T15340
Differential Revision: https://we.phorge.it/D25185
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_string()` as a replacement.
Note: this may highlight other absurd input values that might be worth correcting
instead of just ignoring. If phutil_nonempty_string() throws an exception in your
instance, report it to Phorge to evaluate and fix that specific corner case.
Closes T15339
Test Plan: Applied these four changes and `/dashboard/install/1/project/` finally rendered in web browser.
Reviewers: O1 Blessed Committers, valerio.bozzolan
Reviewed By: O1 Blessed Committers, valerio.bozzolan
Subscribers: speck, tobiaswiese, valerio.bozzolan, Matthew, Cigaryno
Maniphest Tasks: T15339
Differential Revision: https://we.phorge.it/D25184
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_string()` as a replacement.
Note: this may highlight other absurd input values that might be worth correcting
instead of just ignoring. If phutil_nonempty_string() throws an exception in your
instance, report it to Phorge to evaluate and fix that specific corner case.
Closes T15345
Test Plan: After applying this change, the "Edit Panel" page at `/dashboard/panel/edit/2/` correctly rendered in the web browser.
Reviewers: O1 Blessed Committers, valerio.bozzolan
Reviewed By: O1 Blessed Committers, valerio.bozzolan
Subscribers: speck, tobiaswiese, valerio.bozzolan, Matthew, Cigaryno
Maniphest Tasks: T15345
Differential Revision: https://we.phorge.it/D25189
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_string()` as a replacement.
Note: this may highlight other absurd input values that might be worth correcting
instead of just ignoring. If phutil_nonempty_string() throws an exception in your
instance, report it to Phorge to evaluate and fix that specific corner case.
This is not visible in the web user interface, only in the PHP error log.
Closes T15344
Test Plan: Applied this change, on top of D25165 locally applied, and no stacktrace is printed anymore in the PHP error log.
Reviewers: O1 Blessed Committers, valerio.bozzolan
Reviewed By: O1 Blessed Committers, valerio.bozzolan
Subscribers: speck, tobiaswiese, valerio.bozzolan, Matthew, Cigaryno
Maniphest Tasks: T15344
Differential Revision: https://we.phorge.it/D25188
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_string()` as a replacement.
Note: this may highlight other absurd input values that might be worth correcting
instead of just ignoring. If phutil_nonempty_string() throws an exception in your
instance, report it to Phorge to evaluate and fix that specific corner case.
Closes T15348
Test Plan:
Applied this change (on top of D25157) and creation form at `/herald/edit/?content_type=HeraldPreCommitRefAdapter&rule_type=personal` rendered in web browser.
Same applies for other types of personal and global Herald rules.
Reviewers: O1 Blessed Committers, valerio.bozzolan
Reviewed By: O1 Blessed Committers, valerio.bozzolan
Subscribers: speck, tobiaswiese, valerio.bozzolan, Matthew, Cigaryno
Maniphest Tasks: T15348
Differential Revision: https://we.phorge.it/D25190
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_string()` as a replacement.
Note: this may highlight other absurd input values that might be worth correcting
instead of just ignoring. If phutil_nonempty_string() throws an exception in your
instance, report it to Phorge to evaluate and fix that specific corner case.
Closes T15336
Test Plan: Applied this change and `/config/edit/load-libraries/` correctly rendered in web browser.
Reviewers: O1 Blessed Committers, valerio.bozzolan
Reviewed By: O1 Blessed Committers, valerio.bozzolan
Subscribers: speck, tobiaswiese, valerio.bozzolan, Matthew, Cigaryno
Maniphest Tasks: T15336
Differential Revision: https://we.phorge.it/D25181
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_string()` as a replacement.
Note: this may highlight other absurd input values that might be worth correcting
instead of just ignoring. If phutil_nonempty_string() throws an exception in your
instance, report it to Phorge to evaluate and fix that specific corner case.
Closes second 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
Reviewed By: O1 Blessed Committers, valerio.bozzolan
Subscribers: speck, tobiaswiese, valerio.bozzolan, Matthew, Cigaryno
Maniphest Tasks: T15331
Differential Revision: https://we.phorge.it/D25177
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_string()` as a replacement.
Note: this may highlight other absurd input values that might be worth correcting
instead of just ignoring. If phutil_nonempty_string() throws an exception in your
instance, report it to Phorge to evaluate and fix that specific corner case.
Closes T15325
Test Plan: Applied these three changes and all seven subpages (e.g. `/auth/message/user.edit.username/`) finally rendered in web browser.
Reviewers: O1 Blessed Committers, valerio.bozzolan
Reviewed By: O1 Blessed Committers, valerio.bozzolan
Subscribers: speck, tobiaswiese, valerio.bozzolan, Matthew, Cigaryno
Maniphest Tasks: T15325
Differential Revision: https://we.phorge.it/D25172
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_string()` as a replacement.
Note: this may highlight other absurd input values that might be worth correcting
instead of just ignoring. If phutil_nonempty_string() throws an exception in your
instance, report it to Phorge to evaluate and fix that specific corner case.
Closes T15327
Test Plan: Applied this change (on top of D25166) and `/project/1/item/configure/` rendered in web browser.
Reviewers: O1 Blessed Committers, valerio.bozzolan
Reviewed By: O1 Blessed Committers, valerio.bozzolan
Subscribers: speck, tobiaswiese, valerio.bozzolan, Matthew, Cigaryno
Maniphest Tasks: T15327
Differential Revision: https://we.phorge.it/D25173
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_string()` as a replacement.
Note: this may highlight other absurd input values that might be worth correcting
instead of just ignoring. If phutil_nonempty_string() throws an exception in your
instance, report it to Phorge to evaluate and fix that specific corner case.
Closes T15324
Test Plan: Applied this change and `/config/settings/` rendered in web browser.
Reviewers: O1 Blessed Committers, valerio.bozzolan
Reviewed By: O1 Blessed Committers, valerio.bozzolan
Subscribers: speck, tobiaswiese, valerio.bozzolan, Matthew, Cigaryno
Maniphest Tasks: T15324
Differential Revision: https://we.phorge.it/D25171
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_string()` as a replacement.
However, the parameter `$item_id` is a numeric value when populated.
Thus replace `strlen()` with `phutil_nonempty_scalar()` as `phutil_nonempty_string()` could break a Conduit API consumer sending a numeric value.
Note: this may highlight other absurd input values that might be worth correcting
instead of just ignoring. If phutil_nonempty_scalar() throws an exception in your
instance, report it to Phorge to evaluate and fix that specific corner case.
Closes T15317
Test Plan: Applied this change and `/home/menu/configure/` rendered in web browser.
Reviewers: O1 Blessed Committers, valerio.bozzolan
Reviewed By: O1 Blessed Committers, valerio.bozzolan
Subscribers: speck, tobiaswiese, valerio.bozzolan, Matthew, Cigaryno
Maniphest Tasks: T15317
Differential Revision: https://we.phorge.it/D25166
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_string()` as
a general replacement.
Note: this may highlight other absurd input values that might be worth correcting
instead of just ignoring. If phutil_nonempty_string() throws an exception in your
instance, report it to Phorge to evaluate and fix that specific corner case.
Use `phutil_nonempty_scalar()` instead in `PhabricatorSearchDateField.php` as
input could only be integer instead of string.
Closes T15297
Test Plan: Applied these four changes (on top of D25144, D25145, D25146) and `/people/` finally rendered in web browser.
Reviewers: O1 Blessed Committers, valerio.bozzolan
Reviewed By: O1 Blessed Committers, valerio.bozzolan
Subscribers: speck, tobiaswiese, valerio.bozzolan, Matthew, Cigaryno
Maniphest Tasks: T15297
Differential Revision: https://we.phorge.it/D25147
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_string()` as a replacement.
Note: this may highlight other absurd input values that might be worth correcting
instead of just ignoring. If phutil_nonempty_string() throws an exception in your
instance, report it to Phorge to evaluate and fix that specific corner case.
`array_slice()` no longer accepts passing `null` as a parameter.
This behavior is deprecated since PHP 8.1. Adding an if clause; not using a
Null Coalescing Operator (PHP 7+) as Phorge currently still supports PHP 5.5.
Closes T15321
Test Plan:
Applied these two changes on top of D25147. Afterwards, typeahead autocompletion
proposal dropdowns for the three fields "Assigned To", "Subscribers", "Tags" got
displayed in web browser.
Reviewers: O1 Blessed Committers, valerio.bozzolan
Reviewed By: O1 Blessed Committers, valerio.bozzolan
Subscribers: speck, tobiaswiese, valerio.bozzolan, Matthew, Cigaryno
Maniphest Tasks: T15321
Differential Revision: https://we.phorge.it/D25170
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_string()` as a replacement.
Note: this may highlight other absurd input values that might be worth correcting
instead of just ignoring. If phutil_nonempty_string() throws an exception in your
instance, report it to Phorge to evaluate and fix that specific corner case.
Closes T15313
Test Plan:
Applied these three changes (with D25144, D25145, D25146, D25147, D25151,
D25152, D25153 on top).
Afterwards end up with the unresolved exception covered by T15263.
Reviewers: O1 Blessed Committers, valerio.bozzolan
Reviewed By: O1 Blessed Committers, valerio.bozzolan
Subscribers: speck, tobiaswiese, valerio.bozzolan, Matthew, Cigaryno
Maniphest Tasks: T15313
Differential Revision: https://we.phorge.it/D25163
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_string()` as
a general replacement.
In this specific case we use `phutil_nonempty_stringlike()` since we are not sure
if the variable `href` should be just a string or other objects.
In order not to leave these cases to chance, we have added a log line, which can be
removed in the future.
Note: this may highlight other absurd input values that might be worth correcting
instead of just ignoring. If phutil_nonempty_string() throws an exception in your
instance, report it to Phorge to evaluate and fix that specific corner case.
Closes T15303
Ref T15316
Test Plan:
Applied this change (on top of D25144, D25145, D25146, D25147, D25150,
D25142) and `/project/` rendered in web browser.
Reviewers: O1 Blessed Committers, valerio.bozzolan
Reviewed By: O1 Blessed Committers, valerio.bozzolan
Subscribers: avivey, speck, tobiaswiese, valerio.bozzolan, Matthew, Cigaryno
Maniphest Tasks: T15303, T15316
Differential Revision: https://we.phorge.it/D25153
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_string()` as a replacement.
Note: this may highlight other absurd input values that might be worth correcting
instead of just ignoring. If phutil_nonempty_string() throws an exception in your
instance, report it to Phorge to evaluate and fix that specific corner case.
Closes T15320
Test Plan: Applied this change and `/notification/query/advanced/` rendered in web browser.
Reviewers: O1 Blessed Committers, valerio.bozzolan
Reviewed By: O1 Blessed Committers, valerio.bozzolan
Subscribers: speck, tobiaswiese, valerio.bozzolan, Matthew, Cigaryno
Maniphest Tasks: T15320
Differential Revision: https://we.phorge.it/D25169
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_string()` as a replacement.
Note: this may highlight other absurd input values that might be worth correcting
instead of just ignoring. If phutil_nonempty_string() throws an exception in your
instance, report it to Phorge to evaluate and fix that specific corner case.
Closes T15310
Test Plan:
Applied this change (on top of D25144, D25145, D25146, D25147, D25151,
D25152, D25153) and `/settings/panel/editor/` correctly rendered in web browser.
Reviewers: O1 Blessed Committers, valerio.bozzolan
Reviewed By: O1 Blessed Committers, valerio.bozzolan
Subscribers: speck, tobiaswiese, valerio.bozzolan, Matthew, Cigaryno
Maniphest Tasks: T15310
Differential Revision: https://we.phorge.it/D25160
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_string()` as a replacement.
Note: this may highlight other absurd input values that might be worth correcting
instead of just ignoring. If phutil_nonempty_string() throws an exception in your
instance, report it to Phorge to evaluate and fix that specific corner case.
Closes T15319
Test Plan:
Applied this change (on top of D25147, D25153, D25167) and
`/people/editprofile/userid/` finally rendered in web browser.
Reviewers: O1 Blessed Committers, valerio.bozzolan
Reviewed By: O1 Blessed Committers, valerio.bozzolan
Subscribers: speck, tobiaswiese, valerio.bozzolan, Matthew, Cigaryno
Maniphest Tasks: T15319
Differential Revision: https://we.phorge.it/D25168
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_string()` as a replacement.
Note: this may highlight other absurd input values that might be worth correcting
instead of just ignoring. If phutil_nonempty_string() throws an exception in your
instance, report it to Phorge to evaluate and fix that specific corner case.
Closes T15318
Test Plan:
Applied these five changes on top of D25147 and D25153, and both `/p/username/`
and `/people/manage/userid/` finally rendered in web browser.
Reviewers: O1 Blessed Committers, valerio.bozzolan
Reviewed By: O1 Blessed Committers, valerio.bozzolan
Subscribers: speck, tobiaswiese, valerio.bozzolan, Matthew, Cigaryno
Maniphest Tasks: T15318
Differential Revision: https://we.phorge.it/D25167
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_string()` as a replacement.
Note: this may highlight other absurd input values that might be worth correcting
instead of just ignoring. If phutil_nonempty_string() throws an exception in your
instance, report it to Phorge to evaluate and fix that specific corner case.
Closes T15301
Test Plan: Applied this change (on top of D25150) and icons rendered in web browser.
Reviewers: O1 Blessed Committers, valerio.bozzolan
Reviewed By: O1 Blessed Committers, valerio.bozzolan
Subscribers: speck, tobiaswiese, valerio.bozzolan, Matthew, Cigaryno
Maniphest Tasks: T15301
Differential Revision: https://we.phorge.it/D25151