legal characters in an upload file name are breaking the code on a page

4 posts by 2 authors in: Forums > CMS Builder
Last Post: February 17, 2015   (RSS)

Hi All,

Came across a strange issue today.

I'm using a background URL to show an image in a Div "background: url(<?php echo $masterurl ?>/cmsAdmin/uploads/<?php echo
$upload['thumbUrlPath2'] ?>);"

There are certain legal file name characters, like parentheses, that will break this code.

Any thoughts on a way way to strip those characters before they're written to the file name in the upload field?

Thanks,

Jerry Kornbluth

The first CMS Builder reference book is now available on-line!







Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php

By claire - February 17, 2015

Jerry, have you tried quoting the URL in the CSS? like so:

background: url('<?php echo $masterurl ?>/cmsAdmin/uploads/<?php echo $upload['thumbUrlPath2'] ?>');

--------------------

Claire Ryan
interactivetools.com

Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

Works perfectly... (You're soooo smart.)

Thanks,

Jerry Kornbluth

The first CMS Builder reference book is now available on-line!







Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php