X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=application%2Fupdater%2FUpdater.php;fp=application%2Fupdater%2FUpdater.php;h=4f557d0f58fabca7429684eadbf3dfcc82bb1f7c;hb=302662797cb5e8ac6579a99297ceae301f7927a6;hp=88a7bc7b27337a0c572647f0d2ac1ef3027939db;hpb=c94c32d1a3e86a479cb2582eadc668a5bb476fc6;p=github%2Fshaarli%2FShaarli.git diff --git a/application/updater/Updater.php b/application/updater/Updater.php index 88a7bc7b..4f557d0f 100644 --- a/application/updater/Updater.php +++ b/application/updater/Updater.php @@ -88,7 +88,8 @@ class Updater foreach ($this->methods as $method) { // Not an update method or already done, pass. - if (! startsWith($method->getName(), 'updateMethod') + if ( + ! startsWith($method->getName(), 'updateMethod') || in_array($method->getName(), $this->doneUpdates) ) { continue; @@ -121,12 +122,12 @@ class Updater public function readUpdates(string $updatesFilepath): array { - return UpdaterUtils::read_updates_file($updatesFilepath); + return UpdaterUtils::readUpdatesFile($updatesFilepath); } public function writeUpdates(string $updatesFilepath, array $updates): void { - UpdaterUtils::write_updates_file($updatesFilepath, $updates); + UpdaterUtils::writeUpdatesFile($updatesFilepath, $updates); } /** @@ -152,7 +153,8 @@ class Updater $updated = false; foreach ($this->bookmarkService->search() as $bookmark) { - if ($bookmark->isNote() + if ( + $bookmark->isNote() && startsWith($bookmark->getUrl(), '?') && 1 === preg_match('/^\?([a-zA-Z0-9-_@]{6})($|&|#)/', $bookmark->getUrl(), $match) ) {