PHP 7.2 incompatibility: Notice: Undefined offset: 1 in register-settings.php
-
I found an incompatibility with PHP 7.2:
Notice: Undefined offset: 1 in /home/jorjette/public_html/egofelix.com/wp-content/plugins/quick-adsense-reloaded/includes/admin/settings/register-settings.php on line 2164
Notice: Undefined offset: 1 in /home/jorjette/public_html/egofelix.com/wp-content/plugins/quick-adsense-reloaded/includes/admin/settings/register-settings.php on line 2165
Not every line of my data has a colon in it and therefore explode on it returns an array of size 1!
I change the code from lines 2164 and 2165:
preg_match( '#"([a-zA-Z0-9/\s]+)"#', $explode_ad_code[1], $matches_add_slot ); $quads_options['ads'][$key]['g_data_ad_slot'] = str_replace( array('"', ' '), array(''), $matches_add_slot[1] );
With:
preg_match( '#"([a-zA-Z0-9/\s]+)"#', isset($explode_ad_code[1]) ? $explode_ad_code[1] : null, $matches_add_slot ); $quads_options['ads'][$key]['g_data_ad_slot'] = str_replace( array('"', ' '), array(''), isset($matches_add_slot[1]) ? $matches_add_slot[1] : null );
Can you fix this issue in next update?
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘PHP 7.2 incompatibility: Notice: Undefined offset: 1 in register-settings.php’ is closed to new replies.