• Resolved pontusmp

    (@pontusmp)


    First off, thank you for your very practical plugin!

    I stumbled across a fairly minor bug, where a PHP notice is triggered (although it still functions correctly):
    Notice: Undefined property: DiDom\Document::$tag in /landingpages/webroot/wp-content/plugins/gallery-custom-links/mgcl_core.php on line 122

    The loop checks the tag for each node as it walk upward in the DOM, but the topmost (document) node does not have a tag. Something like this should prevent the notice:

    if (($potentialLinkNode instanceof DiDOM\Element) && ($potentialLinkNode->tag === 'a')) {

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Jordy Meow

    (@tigroumeow)

    Hi,

    Indeed, I noticed this also a few days ago ?? I have fixed it a bit differently, but it should be the same, here is my code:

    if ( property_exists( $potentialLinkNode, ‘tag’ ) && $potentialLinkNode->tag === ‘a’ ) {

    Can you try it as well, just to make sure that also works for you? That will be part of the next update. Thanks ??

    Thread Starter pontusmp

    (@pontusmp)

    Yes, your code works fine for me. Looking forward to the next release!

    I got this problem too. Where can I add that code to patch it? I assume mgcl_core.php

    Of course – your code replaces line 122 in mgcl_core.php! I got it to work after replacing the slanted single quotes on ‘tag’ & ‘a’ with straight ones. ??

    Plugin Author Jordy Meow

    (@tigroumeow)

    Hi @joegravity ?? Not sure why the quotes are like this, it seems like this forum changed them :/

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘PHP notice in linkify_element’ is closed to new replies.