1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-26 08:42:41 +01:00
phorge-phorge/src/applications
Andre Klapper 085769ceb6 Fix PHP 8.1 "strlen(null)" exceptions trying to authenticate via custom OAuth provider
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 change also replaces two other `strlen()` calls, only based on //reading// the code but not based on triggering exceptions.

```
EXCEPTION: (RuntimeException) strlen(): Passing null to parameter #1 ($string) of type string is deprecated at [<arcanist>/src/error/PhutilErrorHandler.php:261]
arcanist(), ava(), phorge(), wmf-ext-misc()
  #0 <#2> PhutilErrorHandler::handleError(integer, string, string, integer) called at [<phorge>/applications/auth/adapter/PhutilOAuth1AuthAdapter.php:121]
```

```
EXCEPTION: (RuntimeException) strlen(): Passing null to parameter #1 ($string) of type string is deprecated at [<arcanist>/src/error/PhutilErrorHandler.php:261]
arcanist(), ava(), phorge(), wmf-ext-misc()
  #0 <#2> PhutilErrorHandler::handleError(integer, string, string, integer) called at [<phorge>/applications/auth/adapter/PhutilOAuth1AuthAdapter.php:125]
```

Closes T15588

Test Plan: Go to `/auth/login/mediawiki:whatever/` and at least see no `strlen()` errors anymore (while further issues remain). See T15588 for details.

Reviewers: O1 Blessed Committers, Matthew

Reviewed By: O1 Blessed Committers, Matthew

Subscribers: speck, tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Maniphest Tasks: T15588

Differential Revision: https://we.phorge.it/D25373
2023-08-11 20:57:51 +02:00
..
almanac Provide a default "loadPage()" implementation on "CursorPagedPolicyAwareQuery" 2022-05-24 10:18:53 -07:00
aphlict Aphlict - search for default config in the right place 2023-07-24 00:42:06 -07:00
arcanist/conduit Remove remaining arcanist project code 2015-07-08 19:37:28 +10:00
audit Correct spelling mistake in PhabricatorAuditEditor 2023-05-30 10:43:40 +02:00
auth Fix PHP 8.1 "strlen(null)" exceptions trying to authenticate via custom OAuth provider 2023-08-11 20:57:51 +02:00
badges Provide a default "loadPage()" implementation on "CursorPagedPolicyAwareQuery" 2022-05-24 10:18:53 -07:00
base Fix PHP 8.1 "strlen(null)" exception which blocks rendering most applications' Configure pages 2023-05-08 13:23:31 +02:00
cache Fix various "strlen(null)" PHP 8.1 issues on "bin/phd" and "bin/drydock" pathways 2022-05-03 15:57:15 -07:00
calendar Fix PHP 8.1 "strlen(null)" exceptions which block rendering page to import ICS calendar file 2023-05-08 23:13:12 +02:00
celerity Teach ./bin/celerity about sprite maps 2023-06-03 09:57:05 -07:00
chatlog Replace "getRequestURI()->setQueryParams(array())" with "getPath()" 2019-02-12 14:43:33 -08:00
conduit Fix arc patch PHP 8.1 strlen(null) error 2023-07-29 17:36:13 +01:00
config Generalize references to PHP 5.x Debian/Ubuntu packages 2023-06-29 15:58:54 +03:00
conpherence Fix PHP 8.1 "strlen(null)" exceptions which block rendering the Conpherence page 2023-04-30 18:24:49 +02:00
console Fix PHP 8.1 "strlen(null)" exceptions which block rendering the DarkConsole 2023-05-20 19:18:32 +02:00
countdown Dashboards: add capability who can create Dashboards 2023-06-19 12:12:22 +02:00
daemon Fix various "strlen(null)" PHP 8.1 issues on "bin/phd" and "bin/drydock" pathways 2022-05-03 15:57:15 -07:00
dashboard Hide Archived Panels from Dashboards 2023-08-01 09:51:18 +02:00
differential Replace dedicated Commit Field with an existing one 2023-08-11 11:42:50 -07:00
diffusion Fix PHP 8.1 Diffusion history errors 2023-07-29 13:03:48 +01:00
diviner Fix PHP 8.1 trim(null) exception in ./bin/diviner generate 2023-08-11 10:37:31 +01:00
doorkeeper Provide a default "loadPage()" implementation on "CursorPagedPolicyAwareQuery" 2022-05-24 10:18:53 -07:00
draft/storage Save drafts for inline comments currently being edited 2020-05-04 13:19:42 -07:00
drydock Provide a default "loadPage()" implementation on "CursorPagedPolicyAwareQuery" 2022-05-24 10:18:53 -07:00
fact Fix additional "xprintf()"-class static parameter lint errors 2020-09-08 11:45:48 -07:00
favorites Make "Favorites" work more like other customizable menus 2019-04-09 13:59:35 -07:00
feed Remove "feed.publish" API 2022-05-17 16:30:53 -07:00
files Fix PHP 8.1 strlen(null) error in PhabricatorFile::newChunkedFile() 2023-07-17 14:24:41 +01:00
flag Add a "Remove flag" action to Herald 2019-09-09 13:15:52 -07:00
fund Provide a default "loadPage()" implementation on "CursorPagedPolicyAwareQuery" 2022-05-24 10:18:53 -07:00
guides Remove product literal strings in "pht()", part 5 2022-04-25 12:22:27 -07:00
harbormaster Fix HarbormasterBuildUnitMessage PHP 8.1 strlen(null) error 2023-07-29 13:04:11 +01:00
help Tokenize external editor links so they can be safely materialized on the client 2020-04-19 09:02:49 -07:00
herald Work around exception in Herald transcript of old tasks: Call to a member function getAppliedTransactionPHIDs() on bool 2023-06-12 21:49:14 +02:00
home Fix PHP 8.1 "strlen(null)" exception which blocks rendering the Home page 2023-05-01 15:37:56 +02:00
legalpad Fix PHP 8.1 "strlen(null)" exceptions which block rendering Legalpad signatures 2023-05-19 17:01:53 +02:00
lipsum Add "--force" and "--quickly" flags to bin/lipsum 2017-02-27 09:09:41 -08:00
macro Fix PHP 8.1 "ltrim(null)" exception which blocks rendering first Meme comment 2023-06-10 18:41:00 +02:00
maniphest Fix PHP 8.1 "trim(null)" exception which blocks rendering Reports' Burnup Rate page 2023-05-23 11:58:19 +02:00
meta Fix PHP 8.1 "ltrim(null)" exception which blocks rendering five applications' Configure pages 2023-05-08 14:33:43 +02:00
metamta fix strlen in PhabricatorMailManagementShowOutboundWorkflow 2023-07-02 08:49:02 -07:00
multimeter Fix PHP 8.1 "explode(null)" exception which blocks rendering the Multimeter page 2023-05-29 12:35:54 +02:00
notification Fix a PHP 8.1/8.2 deprecated call to strlen with a NULL argument 2023-08-10 17:36:35 +02:00
nuance Provide a default "loadPage()" implementation on "CursorPagedPolicyAwareQuery" 2022-05-24 10:18:53 -07:00
oauthserver Provide a default "loadPage()" implementation on "CursorPagedPolicyAwareQuery" 2022-05-24 10:18:53 -07:00
owners Fix PHP 8.1 "strlen(null)" and preg_match() exceptions which block rendering "Browse Subscribers" overlay dialog 2023-05-12 12:02:15 +02:00
packages Provide a default "loadPage()" implementation on "CursorPagedPolicyAwareQuery" 2022-05-24 10:18:53 -07:00
passphrase Fix PHP 8.1 "strlen(null)" exception setting Passphrase Credential 2023-08-11 20:56:49 +02:00
paste Provide a default "loadPage()" implementation on "CursorPagedPolicyAwareQuery" 2022-05-24 10:18:53 -07:00
people Fix PHP 8.1 substr(null) in People > Activity Logs 2023-07-17 14:23:30 +01:00
phame Add HTML header for Atom/RSS discovery on Phame blog pages 2023-08-05 23:26:34 +02:00
phid Fix a PHP 8.1 strlen() issue with "mysql.pass" configuration 2021-12-16 15:24:21 -08:00
phlux Convert simple query subclasses to use internal cursors 2019-03-19 13:00:27 -07:00
pholio Fix Pholio RuntimeException: Undefined variable $dictionary (when adding an empty Inline Comment) 2023-06-19 14:13:36 +02:00
phortune Fix typo in PhortuneMerchant.php 2023-05-30 12:00:51 +02:00
phpast Update phpast for new UI 2016-04-05 13:52:59 -07:00
phrequent Convert simple query subclasses to use internal cursors 2019-03-19 13:00:27 -07:00
phriction Implements a more informative hovercard for wiki documents 2023-07-31 17:33:36 +02:00
phurl Provide a default "loadPage()" implementation on "CursorPagedPolicyAwareQuery" 2022-05-24 10:18:53 -07:00
policy Provide a simple "Attach File" explicit workflow for files referenced but not attached 2022-05-24 09:49:59 -07:00
ponder Ponder: strike code of resolved questions in query results 2023-03-27 20:55:18 +02:00
project Workboard Columns: avoid page reload on Edit > Cancel 2023-07-28 19:02:40 +02:00
remarkup Generate file attachment transactions for explicit Remarkup attachments on common edit pathways 2022-05-19 13:21:04 -07:00
repository Fix PHP 8.1 "strlen(null)" exception trying to stop maintenance mode of Diffusion repo 2023-07-18 09:06:25 +01:00
search Fix PHP 8.1/8.2 "strlen(null)" exception in SearchController 2023-08-10 17:42:17 +02:00
settings Fix PHP 8.1 "strlen(null)" exceptions which block adding 2FA factor 2023-05-23 11:53:31 +02:00
slowvote Update Slowvote poll status to use sensible string constants 2022-05-27 10:15:01 -07:00
spaces Fix PHP 8.1 "strlen(null)" exception which blocks Space creation 2023-05-06 04:05:37 +02:00
subscriptions Remove product literal strings in "pht()", part 24 2022-04-25 16:46:26 -07:00
support/application
system Fix information page about Read-only status 2023-03-25 12:06:35 +01:00
tokens Provide a default "loadPage()" implementation on "CursorPagedPolicyAwareQuery" 2022-05-24 10:18:53 -07:00
transactions Auto-subscription: little less verbose 2023-06-15 11:52:02 +02:00
typeahead Fix PHP 8.1 null parameter exceptions which block rendering the "Browse Projects" overlay dialog 2023-05-20 17:48:53 +02:00
uiexample Remove product literal strings in "pht()", part 9 2022-04-25 12:22:29 -07:00
xhprof Provide a default "loadPage()" implementation on "CursorPagedPolicyAwareQuery" 2022-05-24 10:18:53 -07:00