Upload Folder URL change in 3.11

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

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.

By Dave - November 9, 2017

Hi Jeff, 

Thanks for the report.  That's definitely an unintended change.  I can't reproduce it locally just yet but we'll have look into this ASAP Friday morning.

Do you recall what your upload url was set to before?  And where did the image paths change?  In the CMS, viewers, both?  And what did they change to?  Any additional information you might have would be helpful.

If anyone is having an issue related to this feel free to email me direct at dave@interactivetools.com and we'll give you priority support until we get it resolved and/or figure out what the issue is.

Thanks!

Dave Edis - Senior Developer
interactivetools.com

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