WordPress.org

Forums

Fullscreen Galleria
[resolved] PHP warning on the checkout page (3 posts)

  1. kYem
    Member
    Posted 2 years ago #

    Warning: stripos(): Offset not contained in string in /homepages/41/d292723373/htdocs/wp_test/wp-content/plugins/fullscreen-galleria/galleria-fs.php on line 69

    This error shows up on the empty check out page - WP Debug FALSE: http://t.tomasfloor.co.uk/checkout/
    However if something is inside the cart, there will be no warning.

    On my localhost I get one additional notice, with WP Debug TRUE.

    Notice: Uninitialized string offset: 49 in F:\xampp\htdocs\wp\wp-content\plugins\fullscreen-galleria\galleria-fs.php on line 69
    Warning: stripos(): Offset not contained in string in F:\xampp\htdocs\wp\wp-content\plugins\fullscreen-galleria\galleria-fs.php on line 69

    Looking at the code it's

    function tagarg(&$tag, $arg)
      {
        $i = stripos($tag, $arg); // 3
    
        if ($i !== FALSE) {
    
          $len = strlen($tag);
          while ($i < $len && $tag[$i] != "'" && $tag[$i] != '"') {
            ++$i;
          }
           ++$i; // 50
          $j = stripos($tag, $tag[$i - 1], $i);
          if ($j !== FALSE) {
            return substr($tag, $i, $j - $i);
          }
        }
        return '';
      }

    in my case $i would be 50, but the actual tag length is 49 therefore the PHP warning occurs. Seems to me that last pre increment is causing problem, however if I actually comment it out, galleria will stop working (no data attributes added to the link).

    WP e-Commerce Version 3.8.9.5,
    Fullscreen Galleria Version 1.2.2

    http://wordpress.org/extend/plugins/fullscreen-galleria/

  2. pdamsten
    Member
    Plugin Author

    Posted 2 years ago #

    1.2.3 checks values more carefully. It should remove the error but I'm not sure why there is an invalid string in the first place.

  3. kYem
    Member
    Posted 2 years ago #

    Sorry for the late response, but ye it solved the problem thank you once again!

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Fullscreen Galleria
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic