Skip to content

Commit

Permalink
refactor: compare to 0 on preg_match_all()
Browse files Browse the repository at this point in the history
  • Loading branch information
samsonasik committed Dec 27, 2024
1 parent 5caee6a commit aa6f5ee
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions system/Session/Handlers/MemcachedHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,12 +93,12 @@ public function open($path, $name): bool
}

if (
in_array(preg_match_all(
preg_match_all(
'#,?([^,:]+)\:(\d{1,5})(?:\:(\d+))?#',
$this->savePath,
$matches,
PREG_SET_ORDER
), [0, false], true)
) === 0
) {
$this->memcached = null;
$this->logger->error('Session: Invalid Memcached save path format: ' . $this->savePath);
Expand Down
2 changes: 1 addition & 1 deletion system/View/Parser.php
Original file line number Diff line number Diff line change
Expand Up @@ -691,7 +691,7 @@ protected function parsePlugins(string $template)
* $matches[1] = all parameters string in opening tag
* $matches[2] = content between the tags to send to the plugin.
*/
if (in_array(preg_match_all($pattern, $template, $matches, PREG_SET_ORDER), [0, false], true)) {
if (preg_match_all($pattern, $template, $matches, PREG_SET_ORDER) === 0) {
continue;
}

Expand Down

0 comments on commit aa6f5ee

Please sign in to comment.