mirror of
https://we.phorge.it/source/arcanist.git
synced 2024-11-09 16:32:39 +01:00
Promote 2023.17 to stable
This commit is contained in:
commit
8c084061e1
5 changed files with 15 additions and 11 deletions
|
@ -47,12 +47,12 @@ final class PhutilTwitchFuture extends FutureProxy {
|
|||
}
|
||||
|
||||
$uri = new PhutilURI('https://api.twitch.tv/');
|
||||
$uri->setPath('/kraken/'.ltrim($this->action, '/'));
|
||||
$uri->replaceQueryParam('oauth_token', $this->accessToken);
|
||||
$uri->setPath('/helix/'.ltrim($this->action, '/'));
|
||||
|
||||
$future = new HTTPSFuture($uri);
|
||||
$future->setData($this->params);
|
||||
$future->setMethod($this->method);
|
||||
$future->addHeader('Authorization', 'Bearer '.$this->accessToken);
|
||||
|
||||
// NOTE: This is how the Twitch API is versioned.
|
||||
$future->addHeader('Accept', 'application/vnd.twitchtv.2+json');
|
||||
|
@ -87,7 +87,7 @@ final class PhutilTwitchFuture extends FutureProxy {
|
|||
throw new Exception(pht('Received error from Twitch: %s', $error));
|
||||
}
|
||||
|
||||
return $data;
|
||||
return $data['data'][0];
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -203,7 +203,7 @@ final class ArcanistScriptAndRegexLinter extends ArcanistLinter {
|
|||
* @task lint
|
||||
*/
|
||||
public function lintPath($path) {
|
||||
$output = idx($this->output, $path);
|
||||
$output = idx($this->output, $path, '');
|
||||
if (!strlen($output)) {
|
||||
// No output, but it exited 0, so just move on.
|
||||
return;
|
||||
|
@ -337,7 +337,7 @@ final class ArcanistScriptAndRegexLinter extends ArcanistLinter {
|
|||
return array($line + 1, $char + 1);
|
||||
}
|
||||
|
||||
$line = idx($match, 'line');
|
||||
$line = idx($match, 'line', '');
|
||||
if (strlen($line)) {
|
||||
$line = (int)$line;
|
||||
if (!$line) {
|
||||
|
@ -376,7 +376,7 @@ final class ArcanistScriptAndRegexLinter extends ArcanistLinter {
|
|||
'disabled' => ArcanistLintSeverity::SEVERITY_DISABLED,
|
||||
);
|
||||
|
||||
$severity_name = strtolower(idx($match, 'severity'));
|
||||
$severity_name = strtolower(idx($match, 'severity', ''));
|
||||
|
||||
foreach ($map as $name => $severity) {
|
||||
if (!empty($match[$name])) {
|
||||
|
|
|
@ -600,7 +600,7 @@ final class ArcanistGitAPI extends ArcanistRepositoryAPI {
|
|||
public function getCanonicalRevisionName($string) {
|
||||
$match = null;
|
||||
|
||||
if (preg_match('/@([0-9]+)$/', $string, $match)) {
|
||||
if ($string !== null && preg_match('/@([0-9]+)$/', $string, $match)) {
|
||||
$stdout = $this->getHashFromFromSVNRevisionNumber($match[1]);
|
||||
} else {
|
||||
list($stdout) = $this->execxLocal(
|
||||
|
|
|
@ -288,8 +288,12 @@ function phutil_is_utf8_slowly($string, $only_bmp = false) {
|
|||
* @return int The character length of the string.
|
||||
*/
|
||||
function phutil_utf8_strlen($string) {
|
||||
if (function_exists('utf8_decode')) {
|
||||
return strlen(utf8_decode($string));
|
||||
if (function_exists('mb_strlen')) {
|
||||
// Historically, this was just a call to strlen(utf8_decode($string))
|
||||
// but, since PHP 8.2, that function is deprecated, so this is
|
||||
// the current equivalent.
|
||||
// https://we.phorge.it/T15188
|
||||
return mb_strlen($string, 'UTF-8');
|
||||
}
|
||||
return count(phutil_utf8v($string));
|
||||
}
|
||||
|
|
|
@ -479,7 +479,7 @@ abstract class ArcanistWorkflow extends Phobject {
|
|||
// If we have `token`, this server supports the simpler, new-style
|
||||
// token-based authentication. Use that instead of all the certificate
|
||||
// stuff.
|
||||
$token = idx($credentials, 'token');
|
||||
$token = idx($credentials, 'token', '');
|
||||
if (strlen($token)) {
|
||||
$conduit = $this->getConduit();
|
||||
|
||||
|
@ -2244,7 +2244,7 @@ abstract class ArcanistWorkflow extends Phobject {
|
|||
protected function getModernUnitDictionary(array $map) {
|
||||
$map = $this->getModernCommonDictionary($map);
|
||||
|
||||
$details = idx($map, 'userData');
|
||||
$details = idx($map, 'userData', '');
|
||||
if (strlen($details)) {
|
||||
$map['details'] = (string)$details;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue