Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter nkinkade

    (@nkinkade)

    Thanks for the quick reply. When this URL is in $pcontent:

    https://www.youtube.com/watch?v=Q5mHPo2yDG8

    The output of your plugin is:

    https://natha.nkinka.de/misc/fedmich_facebook_open_graph_meta.html

    It’s because the (.*) at the end of the regex on line 101 is greedily matching all the way to the end of the <a/> element, and so is the (.*) on line 107.

    I suppose you could fix this by changing the regex on line 107 to (.*?), but is there a specific the whole conditional block between lines 106-111 exists? It seems to be that you could eliminate everything between lines 100-111 by just changing the regex on line 96 to more thoroughly isolate the video ID. I don’t know what characters can possibly show up in a YouTube video ID, but I would imagine that it certainly can’t include a quote character, so it would seem that changing the regex on 95 to the following would suffice to eliminate lines 100-111:

    ‘@(www\.|)youtube.com/watch\?v=(.*?)”@i’

    Thanks!

    Nathan

    I don’t believe this issue is related to the bug report listed above by Sam_a. I think this is an issue of the plugin being a bit too greedy when it scans the plugins directory for plugins. For example we use subversion to manage our install, and when I tried to activate the plugin I got the following error:

    =====
    /var/www/mysite.com/www/wp-content/plugins/wordpress-https/lib/WordPressHTTPS/Module/Admin/.svn.php): failed to open stream: No such file or directory in /var/www/staging.creativecommons.org/www/wp-content/plugins/wordpress-https/lib/Mvied/Plugin.php on line 372
    =====

    This patch fixed the issue for me, but something else will be required for jabetong. Perhaps the code shouldn’t try to load any plugin whose directory doesn’t begin with /[a-zA-Z0-9]/, to avoid trying to load version control directories or other control dirs:

    https://pastebin.com/ajarUNTX

    Nathan

Viewing 2 replies - 1 through 2 (of 2 total)