[resolved] Undefined Offset Error in Chrome (4 posts)

  1. sxpearce
    Posted 5 years ago #

    I've created the web site at http://www.mitreconstruction.co.uk.
    This runs WordPress 3.1, the Thematic theme and my own child theme.
    Today the client contacted me to say an error was showing at the top of every page.
    This only happens in Google Chrome though.
    Its basically saying there is an undefined offset in the thematic dynamic-class.php file. I quite new to WordPress, but has anyone else got the same problem, or know how to resolve it.

  2. twobyte
    Posted 5 years ago #

    Just comment out these lines in the themes/thematic/library/extensions/dynamic-classes.php file, around line 335..

    preg_match( "/Chrome\/(\d.\d)/si", $browser, $matches);
    		$ch_version = 'ch' . str_replace( '.', '-', $matches[1] );
    		$classes[] = $ch_version;

    For some reason the code to find the version of Chrome does not work, but as you’re unlikely to use this, seeing as all Chrome versions are pretty similar, I suggest just removing it ;-)

  3. kedronrhodes
    Posted 5 years ago #

    The regular expression is breaking because Chrome went to version 10+. It is looking for only 1 digit and Chrome is now 2 digits. To fix this, just change:




    Safari and Opera will break in the same manner when they're version numbers go double digits as well.

  4. sxpearce
    Posted 5 years ago #

    Many thanks to twobyte and kedrhodes, that's done the trick.

Topic Closed

This topic has been closed to new replies.

About this Topic