Closed magnus-eriksson closed 7 years ago
When using the URI extension like this:
$this->uri(2, 'something', 'returnThisOnTrue');
it will throw an E_NOTICE if the current path doesn't have at least two segments (like the start page).
E_NOTICE
Looking at the source in: https://github.com/thephpleague/plates/blob/master/src/Extension/URI.php, it would be better if the check on 91:
if ($this->parts[$key] === $string)
was change to something like:
if (array_key_exists($key, $this->parts) && $this->parts[$key] === $string)
to make sure that the extension doesn't throw notices.
There's a similar issue on line 67: return $this->parts[$var1];
return $this->parts[$var1];
@magnus-eriksson looks good, want to submit an PR for this?
Sure, I'll get on it.
@ragboyjr done.
Fixed with #131. 👍
When using the URI extension like this:
it will throw an
E_NOTICE
if the current path doesn't have at least two segments (like the start page).Looking at the source in: https://github.com/thephpleague/plates/blob/master/src/Extension/URI.php, it would be better if the check on 91:
was change to something like:
to make sure that the extension doesn't throw notices.
There's a similar issue on line 67:
return $this->parts[$var1];