WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. sxpearce
    Member
    Posted 3 years ago #

    I've created the web site at http://www.mitreconstruction.co.uk.
    This runs WordPress 3.1, the Thematic theme 0.9.7.7 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
    Member
    Posted 3 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
    Member
    Posted 3 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:

    Chrome\/(\d.\d)

    to

    Chrome\/(\d+.\d+)

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

  4. sxpearce
    Member
    Posted 3 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