Support » Plugin: mobble » PHP71 Compatibility

  • Hi,

    I’ve got some error with php71 (7.1.8).

    Fatal error: Uncaught Error: [] operator not supported for strings in /Users/penyo/Sites/domain.dev/wp-content/themes/v8/lib/mobble.php:261 Stack trace: #0 /Users/penyo/Sites/domain.dev/wp-content/themes/v8/lib/mobble.php(191): mobble_body_class('') #1 /Users/penyo/Sites/domain.dev/wp-content/themes/v8/base.php(14): mobble_class() #2 /Users/penyo/Sites/domain.dev/wp-includes/template-loader.php(74): include('/Users/penyo/Si...') #3 /Users/penyo/Sites/domain.dev/wp-blog-header.php(19): require_once('/Users/penyo/Si...') #4 /Users/penyo/Sites/domain.dev/index.php(17): require('/Users/penyo/Si...') #5 {main} thrown in /Users/penyo/Sites/domain.dev/wp-content/themes/v8/lib/mobble.php on line 261

    Thanks.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Fixed. Add

    $classes = array();

    at the line:

    	// bonus
    	if ( ! is_handheld() ) {
    		$classes = array();
    		$classes[] = 'desktop';
    	}
    Plugin Author Scott (@scottsweb)

    (@scottsweb)

    I am not sure about this one. $classes should be an array long before then. It gets passed in here: https://github.com/scottsweb/mobble/blob/master/mobble.php#L437 from the filter. It seems odd setting it later on does the trick. This would also destroy any existing classes.

    pakpenyo

    (@pakpenyo)

    Now i’m using with :

    global $is_lynx, $is_gecko, $is_IE, $is_opera, $is_NS4, $is_safari, $is_chrome, $is_edge, $mobble_detect;
    $classes = array();
    

    I’m using mobble with html class, not body class.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘PHP71 Compatibility’ is closed to new replies.