From 5a63b7eed746a0e8a8bc910934e349ea7dab524a Mon Sep 17 00:00:00 2001 From: Ryan Cramer Date: Tue, 10 May 2022 09:46:45 -0400 Subject: [PATCH] Fix issue processwire/processwire-issues#1566 --- wire/core/Pageimages.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wire/core/Pageimages.php b/wire/core/Pageimages.php index 05fc2f49..da1a80b7 100644 --- a/wire/core/Pageimages.php +++ b/wire/core/Pageimages.php @@ -84,10 +84,10 @@ class Pageimages extends Pagefiles { // populate $base with $name sans ImageSizer info and extension $name = basename($name); $pos = strpos($name, '.'); - $base = substr($name, 0, $pos); + $base = ($pos ? substr($name, 0, $pos) : null); foreach($this as $pagefile) { - if(strpos($pagefile->basename, $base) !== 0) continue; + if($base !== null && strpos($pagefile->basename, $base) !== 0) continue; // they start the same, is it a variation? if(!$pagefile->isVariation($name)) continue; // if we are here we found a variation