Преглед изворни кода

Fix getNonStandardShortcuts (#3924)

#fix https://github.com/FreshRSS/FreshRSS/issues/3922
Quick fix. The `getNonStandardShortcuts()` could probably be re-written.
Alexandre Alapetite пре 4 година
родитељ
комит
c5ab4cea4a
1 измењених фајлова са 2 додато и 4 уклоњено
  1. 2 4
      lib/lib_rss.php

+ 2 - 4
lib/lib_rss.php

@@ -538,10 +538,8 @@ function getNonStandardShortcuts($shortcuts) {
 	$standard = strtolower(implode(' ', SHORTCUT_KEYS));
 	$standard = strtolower(implode(' ', SHORTCUT_KEYS));
 
 
 	$nonStandard = array_filter($shortcuts, function ($shortcut) use ($standard) {
 	$nonStandard = array_filter($shortcuts, function ($shortcut) use ($standard) {
-		if (false !== strpos($shortcut, ' ')) {
-			return true;
-		}
-		return !preg_match("/${shortcut}/i", $standard);
+		$shortcut = trim($shortcut);
+		return $shortcut !== '' & stripos($standard, $shortcut) === false;
 	});
 	});
 
 
 	return $nonStandard;
 	return $nonStandard;