Support » Plugin: Search Everything » Trying to access array offset on value of type bool

  • I assume this plug-in is no longer updated……..
    So if you experience PHP notice Trying to access array offset on value of type bool on PHP 7.4 you can circumvent this by changing code in config.php line 29
    old code
    if(!$se_options || $se_meta['version'] !== SE_VERSION) {
    new code
    if(!$se_options || !$se_meta || (!isset($se_meta['version']) && SE_VERSION !== $se_meta['version'])) {

Viewing 1 replies (of 1 total)
  • My fix:

    php
    if(!$se_options || !$se_meta || $se_meta['version'] !== SE_VERSION) {
    

    I think this is enough, but if you want to be on the safe side it would be:

    php
    if(!$se_options || !$se_meta || !array_key_exists('version', $se_meta) ||  $se_meta['version'] !== SE_VERSION)
    

    Because isset doesn’t check if array key exists.

    • This reply was modified 1 year, 2 months ago by Preliot.
    • This reply was modified 1 year, 2 months ago by Preliot. Reason: Code formatting
Viewing 1 replies (of 1 total)
  • The topic ‘Trying to access array offset on value of type bool’ is closed to new replies.