Support » Plugin: Menu Icons by ThemeIsle » 0.12.6

  • Resolved frankieandshadow

    (@frankieandshadow)


    Hi,
    The 0.12.6 update crashes site pages for me (“a critical error has occurred on your site”). The problem is at line 429 of includes/front.php where it is trying to call $xmlget->attributes() but $xmlget isn’t a handle it is Boolean FALSE. That’s because simplexml_load_string is failing, so returning FALSE. Now, you’re not going to like this… it is failing because I am using the plugin to load PNG files, as well as SVG. I know this isn’t what was intended, but it has worked for many years like that, I just had to cheat slightly when selecting the file.

    So, when it reads the file it gets PNG content, which naturally simplexml won’t read. You might be inclined to dismiss that because I’m not quite doing what was intended, but I think it would also happen in the case of a malformed SVG file. I think it would be very helpful if the result of simplexml_load_string were checked and the remaining code only executed if it succeeds.

    Unfortunately I only discovered this on my live site, as on a test version, the file_get_contents just above failed because my test site is behind a basic-auth password, so a request without the password over HTTP failed. But it failed safe, as the img tag was still then generated correctly (except the width and height attributes on the image weren’t set correctly), it just skipped the sanity check that this version added. If it can skip that check when the file fails to read, I think it is reasonable to also skip if it can’t read in the XML reader either. In either case, I think it should then omit the width and height attributes.

    For the moment, I am just going to leave it on the older plugin version rather than change the code locally.

    The page I need help with: [log in to see the link]

Viewing 7 replies - 1 through 7 (of 7 total)
Viewing 7 replies - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.