Sterc / revolution

MODX Revolution - Content Management Framework
https://modx.com/
GNU General Public License v2.0
6 stars 1 forks source link

prepareSrcForThumb fix #43

Open wax100 opened 3 years ago

wax100 commented 3 years ago

What does it do?

Fix prepareSrcForThumb function. First check if src contain HTTP(S). If yes - return full url, if not - continue checking

Why is it needed?

Because right now first run checking, that check if file exist in filesystem.

try {
                if (!$this->filesystem->has($src)) {
                    return '';
                }
            } catch (Exception $e) {
                return '';
            }

But we check NOT file, but URL. if (substr($src,0,4) != 'http') { So first we should check file it is or url.

BEFORE Screenshot_2

AFTER Screenshot_5