Don't save next autoincrement base if it's going to fail, next

This commit is contained in:
Brady Wetherington 2024-06-03 15:58:57 +01:00
parent dc62e393c3
commit 90818bb147

View file

@ -92,7 +92,7 @@ class AssetObserver
// only modify the 'next' one if it's *bigger* than the stored base
//
if($next_asset_tag > $settings->next_auto_tag_base) {
if ($next_asset_tag > $settings->next_auto_tag_base && $next_asset_tag < PHP_INT_MAX) {
$settings->next_auto_tag_base = $next_asset_tag;
$settings->save();
}