Compare commits
2 commits
cf61449b90
...
99f86e6e15
| Author | SHA1 | Date | |
|---|---|---|---|
| 99f86e6e15 | |||
| 77ec830cc6 |
3 changed files with 6 additions and 5 deletions
|
|
@ -144,16 +144,17 @@ abstract class PatchBase {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
private function regex(string $pattern) {
|
private function regex(string $pattern) {
|
||||||
if (!preg_match($pattern, $this->data, $m))
|
if (!preg_match_all($pattern, $this->data, $m, PREG_PATTERN_ORDER))
|
||||||
return false;
|
return false;
|
||||||
// suppress full pattern match
|
// suppress full pattern match
|
||||||
unset($m[0]);
|
$m = $m[1];
|
||||||
|
// TODO - add option: $m = array_reverse($m);
|
||||||
return $m;
|
return $m;
|
||||||
}
|
}
|
||||||
private function regex_str(string $pattern) {
|
private function regex_str(string $pattern) {
|
||||||
$m = $this->regex($pattern);
|
$m = $this->regex($pattern);
|
||||||
if ($m)
|
if ($m)
|
||||||
return $m[1];
|
return $m[0];
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ class CookieAutoDeleteChrome extends PatchBase {
|
||||||
}
|
}
|
||||||
function check() : bool {
|
function check() : bool {
|
||||||
if ($this->fetch('https://chrome.google.com/webstore/detail/cookie-autodelete/fhcgjolkccmbidfldomjliifgaodjagh'))
|
if ($this->fetch('https://chrome.google.com/webstore/detail/cookie-autodelete/fhcgjolkccmbidfldomjliifgaodjagh'))
|
||||||
return $this->parse('/\\\"version\\\": \\\"([\d\.]+)\\\"/');
|
return $this->parse('/<div class="N3EXSc">([\d\.]+)<\/div>/');
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ class LocalCDNChrome extends PatchBase {
|
||||||
}
|
}
|
||||||
function check() : bool {
|
function check() : bool {
|
||||||
if ($this->fetch('https://chrome.google.com/webstore/detail/localcdn/njdfdhgcmkocbgbhcioffdbicglldapd'))
|
if ($this->fetch('https://chrome.google.com/webstore/detail/localcdn/njdfdhgcmkocbgbhcioffdbicglldapd'))
|
||||||
return $this->parse('/\\\"version\\\": \\\"([\d\.]+)\\\"/');
|
return $this->parse('/<div class="N3EXSc">([\d\.]+)<\/div>/');
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue