瀏覽代碼

fixed stripos of getImagesSelect function

CauseFX 4 年之前
父節點
當前提交
09fc49c48a
共有 1 個文件被更改,包括 6 次插入2 次删除
  1. 6 2
      api/classes/organizr.class.php

+ 6 - 2
api/classes/organizr.class.php

@@ -1676,7 +1676,7 @@ class Organizr
 				}
 				return false;
 			} else {
-				// Check if user is on same brower as token
+				// Check if user is on same browser as token
 				if ($allTokens[$tokenKey]['browser'] !== $_SERVER ['HTTP_USER_AGENT']) {
 					$this->setLoggerChannel('Authentication')->warning('Mismatch of useragent');
 					$this->invalidToken($token);
@@ -1963,7 +1963,11 @@ class Organizr
 			];
 		}
 		foreach ($newImageListing as $k => $v) {
-			if (stripos($v['text'], $term) !== false || !$term) {
+			if ($term) {
+				if (stripos($v['text'], $term) !== false) {
+					$goodIcons['results'][] = $v;
+				}
+			} else {
 				$goodIcons['results'][] = $v;
 			}
 		}