greenrivers / grav-plugin-webp

Grav Webp plugin.
MIT License
11 stars 0 forks source link

Plugin crashes after activation #1

Closed mkocus closed 3 years ago

mkocus commented 3 years ago

I've tried to activate your plugin using grav admin menu, have installed all requirements.

It crashes whole grav (both page and admin menu) on webp.php here:

public function onPagesInitialized()
    {
        /** @var SessionInterface $session */
        $session = $this->grav['session'];

        /** @var Uri $uri */
        $uri = $this->grav['uri'];

        $paths = $uri->paths();

        if ($paths[2] === 'webp' && $paths[3]) {   /** CRASH HERE */

because the $paths length is 3, so it cannot access $paths[3]

MajorKuprich commented 3 years ago

Hello,

Thank You for catching this bug :-) Fixed in commit.