From c4bc3a3d473cb48a9273202cd71ef2f0832444ba Mon Sep 17 00:00:00 2001 From: zenggang Date: Mon, 7 Aug 2023 06:49:19 +0000 Subject: [PATCH] * Fix bug#37020,37076 --- lib/requests/Requests/Cookie/Jar.php | 10 +++++----- lib/requests/Requests/Response/Headers.php | 6 +++--- .../Requests/Utility/CaseInsensitiveDictionary.php | 10 +++++----- module/gitea/control.php | 2 +- module/gogs/control.php | 2 +- module/jenkins/control.php | 2 +- module/sonarqube/control.php | 2 +- 7 files changed, 17 insertions(+), 17 deletions(-) diff --git a/lib/requests/Requests/Cookie/Jar.php b/lib/requests/Requests/Cookie/Jar.php index a816f90a0a..bc3b748a65 100644 --- a/lib/requests/Requests/Cookie/Jar.php +++ b/lib/requests/Requests/Cookie/Jar.php @@ -60,7 +60,7 @@ class Requests_Cookie_Jar implements ArrayAccess, IteratorAggregate { * @param string $key Item key * @return boolean Does the item exist? */ - public function offsetExists($key) { + public function offsetExists($key): bool { return isset($this->cookies[$key]); } @@ -70,7 +70,7 @@ class Requests_Cookie_Jar implements ArrayAccess, IteratorAggregate { * @param string $key Item key * @return string|null Item value (null if offsetExists is false) */ - public function offsetGet($key) { + public function offsetGet($key): string|null { if (!isset($this->cookies[$key])) { return null; } @@ -86,7 +86,7 @@ class Requests_Cookie_Jar implements ArrayAccess, IteratorAggregate { * @param string $key Item name * @param string $value Item value */ - public function offsetSet($key, $value) { + public function offsetSet($key, $value): void { if ($key === null) { throw new Requests_Exception('Object is a dictionary, not a list', 'invalidset'); } @@ -99,7 +99,7 @@ class Requests_Cookie_Jar implements ArrayAccess, IteratorAggregate { * * @param string $key */ - public function offsetUnset($key) { + public function offsetUnset($key): void { unset($this->cookies[$key]); } @@ -108,7 +108,7 @@ class Requests_Cookie_Jar implements ArrayAccess, IteratorAggregate { * * @return ArrayIterator */ - public function getIterator() { + public function getIterator(): ArrayIterator { return new ArrayIterator($this->cookies); } diff --git a/lib/requests/Requests/Response/Headers.php b/lib/requests/Requests/Response/Headers.php index 12db128ae5..e3740b711a 100644 --- a/lib/requests/Requests/Response/Headers.php +++ b/lib/requests/Requests/Response/Headers.php @@ -23,7 +23,7 @@ class Requests_Response_Headers extends Requests_Utility_CaseInsensitiveDictiona * @param string $key * @return string|null Header value */ - public function offsetGet($key) { + public function offsetGet($key): string|null { $key = strtolower($key); if (!isset($this->data[$key])) { return null; @@ -40,7 +40,7 @@ class Requests_Response_Headers extends Requests_Utility_CaseInsensitiveDictiona * @param string $key Item name * @param string $value Item value */ - public function offsetSet($key, $value) { + public function offsetSet($key, $value): void { if ($key === null) { throw new Requests_Exception('Object is a dictionary, not a list', 'invalidset'); } @@ -92,7 +92,7 @@ class Requests_Response_Headers extends Requests_Utility_CaseInsensitiveDictiona * Converts the internal * @return ArrayIterator */ - public function getIterator() { + public function getIterator(): ArrayIterator { return new Requests_Utility_FilteredIterator($this->data, array($this, 'flatten')); } } diff --git a/lib/requests/Requests/Utility/CaseInsensitiveDictionary.php b/lib/requests/Requests/Utility/CaseInsensitiveDictionary.php index 7eebeb7a72..4914480c54 100644 --- a/lib/requests/Requests/Utility/CaseInsensitiveDictionary.php +++ b/lib/requests/Requests/Utility/CaseInsensitiveDictionary.php @@ -37,7 +37,7 @@ class Requests_Utility_CaseInsensitiveDictionary implements ArrayAccess, Iterato * @param string $key Item key * @return boolean Does the item exist? */ - public function offsetExists($key) { + public function offsetExists($key): bool { $key = strtolower($key); return isset($this->data[$key]); } @@ -48,7 +48,7 @@ class Requests_Utility_CaseInsensitiveDictionary implements ArrayAccess, Iterato * @param string $key Item key * @return string|null Item value (null if offsetExists is false) */ - public function offsetGet($key) { + public function offsetGet($key): string|null { $key = strtolower($key); if (!isset($this->data[$key])) { return null; @@ -65,7 +65,7 @@ class Requests_Utility_CaseInsensitiveDictionary implements ArrayAccess, Iterato * @param string $key Item name * @param string $value Item value */ - public function offsetSet($key, $value) { + public function offsetSet($key, $value): void { if ($key === null) { throw new Requests_Exception('Object is a dictionary, not a list', 'invalidset'); } @@ -79,7 +79,7 @@ class Requests_Utility_CaseInsensitiveDictionary implements ArrayAccess, Iterato * * @param string $key */ - public function offsetUnset($key) { + public function offsetUnset($key): void { unset($this->data[strtolower($key)]); } @@ -88,7 +88,7 @@ class Requests_Utility_CaseInsensitiveDictionary implements ArrayAccess, Iterato * * @return ArrayIterator */ - public function getIterator() { + public function getIterator(): ArrayIterator { return new ArrayIterator($this->data); } diff --git a/module/gitea/control.php b/module/gitea/control.php index 73c3a73d99..37365980d8 100644 --- a/module/gitea/control.php +++ b/module/gitea/control.php @@ -82,7 +82,7 @@ class gitea extends control if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError())); $actionID = $this->loadModel('action')->create('gitea', $giteaID, 'created'); - return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => inlink('browse'))); + return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => $this->createLink('space', 'browse'))); } $this->view->title = $this->lang->gitea->common . $this->lang->colon . $this->lang->gitea->lblCreate; diff --git a/module/gogs/control.php b/module/gogs/control.php index ca82ec2fb7..77ef72dfcd 100644 --- a/module/gogs/control.php +++ b/module/gogs/control.php @@ -81,7 +81,7 @@ class gogs extends control if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError())); $actionID = $this->loadModel('action')->create('gogs', $gogsID, 'created'); - return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => inlink('browse'))); + return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => $this->createLink('space', 'browse'))); } $this->view->title = $this->lang->gogs->common . $this->lang->colon . $this->lang->gogs->lblCreate; diff --git a/module/jenkins/control.php b/module/jenkins/control.php index 6b3db5d861..e46b78a74d 100644 --- a/module/jenkins/control.php +++ b/module/jenkins/control.php @@ -70,7 +70,7 @@ class jenkins extends control if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError())); if($this->viewType == 'json') return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'id' => $jenkinsID)); - return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => inlink('browse'))); + return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => $this->createLink('space', 'browse'))); } $this->view->title = $this->lang->jenkins->common . $this->lang->colon . $this->lang->jenkins->create; diff --git a/module/sonarqube/control.php b/module/sonarqube/control.php index dae6dd7320..3e0ff91f50 100644 --- a/module/sonarqube/control.php +++ b/module/sonarqube/control.php @@ -145,7 +145,7 @@ class sonarqube extends control if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError())); $this->loadModel('action')->create('sonarqube', $sonarqubeID, 'created'); - return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => inlink('browse'))); + return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => $this->createLink('space', 'browse'))); } $this->view->title = $this->lang->sonarqube->common . $this->lang->colon . $this->lang->sonarqube->createServer;