diff --git a/PatchBase.php b/PatchBase.php index 794989b..9eeb332 100644 --- a/PatchBase.php +++ b/PatchBase.php @@ -144,17 +144,16 @@ abstract class PatchBase { return false; } private function regex(string $pattern) { - if (!preg_match_all($pattern, $this->data, $m, PREG_PATTERN_ORDER)) + if (!preg_match($pattern, $this->data, $m)) return false; // suppress full pattern match - $m = $m[1]; - // TODO - add option: $m = array_reverse($m); + unset($m[0]); return $m; } private function regex_str(string $pattern) { $m = $this->regex($pattern); if ($m) - return $m[0]; + return $m[1]; return false; } } diff --git a/modules/CookieAutoDeleteChrome.php b/modules/CookieAutoDeleteChrome.php index 2aac2db..208330a 100644 --- a/modules/CookieAutoDeleteChrome.php +++ b/modules/CookieAutoDeleteChrome.php @@ -7,7 +7,7 @@ class CookieAutoDeleteChrome extends PatchBase { } function check() : bool { if ($this->fetch('https://chrome.google.com/webstore/detail/cookie-autodelete/fhcgjolkccmbidfldomjliifgaodjagh')) - return $this->parse('/