summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorPaul Tirk <paultirk@paultirk.com>2021-03-29 10:17:32 +0200
committerSean Molenaar <SMillerDev@users.noreply.github.com>2021-04-08 10:23:11 +0200
commitf18adeba268bcfb7dc4d0cf9a7b4419e6616cd36 (patch)
tree30f9ed09dbf84309cf78dccfe205034ee28aa8c7 /lib
parentf358c8213b5110144de207c2571a716dba3f0031 (diff)
fix invalid 'empty' checks
Signed-off-by: Paul Tirk <paultirk@paultirk.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/Controller/FolderApiV2Controller.php4
-rw-r--r--lib/Db/Feed.php2
2 files changed, 3 insertions, 3 deletions
diff --git a/lib/Controller/FolderApiV2Controller.php b/lib/Controller/FolderApiV2Controller.php
index 3c9a12c14..8855ba237 100644
--- a/lib/Controller/FolderApiV2Controller.php
+++ b/lib/Controller/FolderApiV2Controller.php
@@ -56,7 +56,7 @@ class FolderApiV2Controller extends ApiController
*/
public function create(string $name)
{
- if (empty($name)) {
+ if (trim($name) === '') {
return $this->errorResponseV2('folder name is empty', 1, Http::STATUS_BAD_REQUEST);
}
@@ -79,7 +79,7 @@ class FolderApiV2Controller extends ApiController
*/
public function update(int $folderId, string $name)
{
- if (empty($name)) {
+ if (trim($name) === '') {
return $this->errorResponseV2('folder name is empty', 1, Http::STATUS_BAD_REQUEST);
}
diff --git a/lib/Db/Feed.php b/lib/Db/Feed.php
index 8a23f731a..3c371087b 100644
--- a/lib/Db/Feed.php
+++ b/lib/Db/Feed.php
@@ -676,7 +676,7 @@ class Feed extends Entity implements IAPI, \JsonSerializable
'isPinned' => $this->getPinned()
];
- if (!empty($this->getLastUpdateError())) {
+ if (!is_null($this->getLastUpdateError()) || trim($this->getLastUpdateError()) !== '') {
$result['error'] = [
'code' => 1,
'message' => $this->getLastUpdateError()