Skip to content

Commit aa6f5ee

Browse files
committed
refactor: compare to 0 on preg_match_all()
1 parent 5caee6a commit aa6f5ee

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

system/Session/Handlers/MemcachedHandler.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,12 +93,12 @@ public function open($path, $name): bool
9393
}
9494

9595
if (
96-
in_array(preg_match_all(
96+
preg_match_all(
9797
'#,?([^,:]+)\:(\d{1,5})(?:\:(\d+))?#',
9898
$this->savePath,
9999
$matches,
100100
PREG_SET_ORDER
101-
), [0, false], true)
101+
) === 0
102102
) {
103103
$this->memcached = null;
104104
$this->logger->error('Session: Invalid Memcached save path format: ' . $this->savePath);

system/View/Parser.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -691,7 +691,7 @@ protected function parsePlugins(string $template)
691691
* $matches[1] = all parameters string in opening tag
692692
* $matches[2] = content between the tags to send to the plugin.
693693
*/
694-
if (in_array(preg_match_all($pattern, $template, $matches, PREG_SET_ORDER), [0, false], true)) {
694+
if (preg_match_all($pattern, $template, $matches, PREG_SET_ORDER) === 0) {
695695
continue;
696696
}
697697

0 commit comments

Comments
 (0)