I have this error appear in php 7.3
Deprecated: strpos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior
The line is :
if ($this->Category->getPath() && strpos('_', $this->Category->getPath())) {
It seems it come from this code : strpos('_', $this->Category->getPath()
$this->Category->getPath()
can return this value for example :
int(8) string(3) "8_9"
This behavior is deprecated as of PHP 7.3. 0, and relying on it is highly discouraged. Depending on the intended behavior, the needle should either be explicitly cast to string, or an explicit call to chr() should be performed.
The strpos() function finds the position of the first occurrence of a string inside another string.
This worked for me
$suffix = strval($this->config->item('controller_suffix')); $pos = !empty($suffix) ? strpos($class, $suffix) : FALSE; if ($pos === FALSE) { $class .= $suffix; } parent::set_class($class);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With