Upload Folder URL change in 3.11

7 posts by 3 authors in: Forums > CMS Builder
Last Post: November 10, 2017   (RSS)

Just upgraded to 3.11 and all my images broke.

Checked Upload Folder URL and had to change it from 'uploads' to 'cmsb/uploads'. This is an undocumented change.

Jeff Shields

By Deborah - November 9, 2017

My only upgrade is one I did today on a test site that uses custom upload directories. I see a break in images links there within CMSB, but haven't traced the source or resolved it.

Didn't have enough time to test the beta, unfortunately.

The upload url was simply 'uploads' and the preview was '/cmsb/uploads'. This particular site started with version 2.3 or there abouts.

I had to add 'cmsb/' to the Upload Folder URL to get the proper preview.

Other sites that started with 2.65 already had 'cmsb/uploads'.

I don't think it is an issue as long as everyone is aware that it MIGHT need to be updated. 

It affected both admin and viewers.

Jeff Shields

One other thing is that the example says:

Example: uploads or ../uploads (relative to current URL)

Jeff Shields

By Dave - November 10, 2017

Hi All, 

Thanks everyone for the feedback, here's a temporary patch while we get a new release out.  Can you try this fix?

In lib/validation_functions, search for: function endsWith
And replace it with this:

function endsWith($needle, $haystack, $caseSensitive = true) { // v3.11 added $caseSensitive
  $expectedPosition = mb_strlen($haystack) - mb_strlen($needle);
  if     ($needle === "") { $bool = true; }
  elseif ($caseSensitive) { $bool = (mb_strrpos($haystack, $needle) === $expectedPosition); }
  else                    { $bool = (mb_strripos($haystack, $needle) === $expectedPosition); }
  return $bool;
}

And then revert any upload paths to what you had before.  The issue occurs with any relative paths not getting automatically converted to absolute paths correctly.

Let me know if that works for you!

Dave Edis - Senior Developer
interactivetools.com

By Dave - November 10, 2017

And a further update on this.  We've patched the current version with the above fix and you can download it here: 
https://www.interactivetools.com/order/download.php

Note that the only file that has changed is /lib/validation_functions.php.  

Thanks everybody for your patience and understanding and please let us know if you run into any other issues.

Dave Edis - Senior Developer
interactivetools.com