mirror of
https://we.phorge.it/source/arcanist.git
synced 2024-11-21 22:32:41 +01:00
Fix PHP 8.1 "strlen(null)" exception in PhutilOAuth1Future
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. ``` ERROR 8192: urlencode(): Passing null to parameter #1 ($string) of type string is deprecated at [/var/www/html/phorge/arcanist/src/future/oauth/PhutilOAuth1Future.php:232] ``` Closes T15929 Test Plan: Run `arcanist/bin/arc unit --everything` on a PHP >= 8.1 system. Reviewers: O1 Blessed Committers, valerio.bozzolan Reviewed By: O1 Blessed Committers, valerio.bozzolan Subscribers: speck, tobiaswiese, valerio.bozzolan, Matthew, Cigaryno Maniphest Tasks: T15929 Differential Revision: https://we.phorge.it/D25811
This commit is contained in:
parent
ead6759082
commit
0358ff7ee3
1 changed files with 2 additions and 1 deletions
|
@ -225,11 +225,12 @@ final class PhutilOAuth1Future extends FutureProxy {
|
|||
|
||||
private function signString($string) {
|
||||
$consumer_secret = null;
|
||||
$key = '';
|
||||
if ($this->consumerSecret) {
|
||||
$consumer_secret = $this->consumerSecret->openEnvelope();
|
||||
$key .= urlencode($consumer_secret).'&';
|
||||
}
|
||||
|
||||
$key = urlencode($consumer_secret).'&';
|
||||
if ($this->tokenSecret !== null) {
|
||||
$key .= urlencode($this->tokenSecret);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue