Support » Plugin: Root Relative URLs » Limited blacklist

  • I think there’s some limitation in the current blacklist implementation and also the help in the settings page is misleading users.

    For my understanding the blacklist is only used for feeds purposes, generating a new absolute url with the current proto://host, while would be useful to have the chance to blacklist url keeping the original url, I just tried to enqueue holder.js from a cdn and it failed because the plugin replace the proto://host part of the url.

    You can use partial URLs

    But current implementation is:
    if (stripos(get_option('emc2_blacklist_urls'), $cur_url) !== false) {
    Where $cur_url is an absolute url given by dynamic_absolute_url over which users have no control, stripos find $cur_url in the blacklist string, for my understanding I’ve to put at least a string equal to $cur_url in the blacklist.

    Below a patch for a different behavior (surely could be optimized), if the blacklist url begin with http (http/https) the url will remain untouched (the original proto://host), if the url begin with / (slash) the url will be a dynamic absolute.

    patch

    Thanks for the plugin.
    Cheers

    https://wordpress.org/plugins/root-relative-urls/

  • The topic ‘Limited blacklist’ is closed to new replies.