WordPress.org

Support

Support » Themes and Templates » [Resolved] Undefined Offset Error in Chrome

[Resolved] Undefined Offset Error in Chrome

  • 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.

Viewing 3 replies - 1 through 3 (of 3 total)
  • 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 😉

    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.

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

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Resolved] Undefined Offset Error in Chrome’ is closed to new replies.
Skip to toolbar