WordPress.org

Ready to get started?Download WordPress

Forums

WP About Author
[resolved] Double Slash Breaks CDN (4 posts)

  1. Matt Fiocca
    Member
    Posted 10 months ago #

    I found a bug that breaks links to the social images when hosting in a CDN

    wp-about-author.php, line 12: plugin_dir_url()

    That function returns the url with an ending slash "/".

    wp-about-author.php, line 129: wp_about_author_get_socials()

    That function creates urls to the images, prefixed with a "/". So, what this does is create image uri's like this:

    [site_url]/wp-content/plugins/wp-about-author//images/twitter.png

    Notice the double slash in front of //images/twitter.png. Under normal hosting conditions, this usually isn't an issue. apache takes care of it. But, in a CDN like s3+cloudfront, this is broken. e.g.

    http://d3v3e9zt7hyzjw.cloudfront.net/wp-content/plugins/wp-about-author//images/twitter.png

    vs

    http://d3v3e9zt7hyzjw.cloudfront.net/wp-content/plugins/wp-about-author/images/twitter.png

    http://wordpress.org/plugins/wp-about-author/

  2. Matt Fiocca
    Member
    Posted 10 months ago #

    my recommendation to the plugin author is to remove the slashes in front of the image paths in lines 131 to 142 in wp-about-author.php: e.g.

    WPAUTHORURL_URL .'/images/twitter.png'

    becomes

    WPAUTHORURL_URL .'images/twitter.png'

  3. Matt Fiocca
    Member
    Posted 10 months ago #

    i should point out that i'm using W3 Total Cache that rewrites our blog url with our CDN url, in case there was any confusion in that regard

  4. Jon Bishop
    Member
    Plugin Author

    Posted 4 months ago #

    Removed the slashes in the latest version. Thanks for the help!

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.