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

    (@fedsmith)

    I fixed this problem. It’s not ideal as it’s hardcoded based on the actual URL’s for my website and custom CNAME for the Rackspace cloud files container, but it works. I hope the developer can use this information to implement a permanent fix in a future upgrade because overall this plugin seems great.

    Here are the details for anybody else who might encounter this problem. The change I made assumes a custom CNAME of https://img.example.com is being used to point to the Rackspace cloud files container.

    In lib/functions.php around line 493, you will find this line:

    $attachment = str_replace($cur_attachment, $cdn_url.'/'.$new_attachment, $attachment);

    Immediately after this line, I added the following line (including a few lines of comments for explanation):

    // this function is returning media attachment urls as:
                            // https://img.example.com/https://www.example.com/wp-content/uploads/2015/01/RetirementIncomePlan_PartTime.png
                            // added the below line to strip out the extraneous URL
                            $attachment = str_replace('https://www.example.com/wp-content/uploads/', '', $attachment);

    I used your fix to get mine working… though the instrcution confused me a bit.

    I found the line 493 and the code. I had to make this edit to get it to work.

    $attachment = str_replace('myCDN-CNAME.r59.cf2.rackcdn.com', '/wp-content/uploads/', $attachment);

    then it worked… thanks so much for the fix.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Media library links broken’ is closed to new replies.