Jump to content

Archived

This topic is now archived and is closed to further replies.

BrockleyJohn

Spaces in image names

Recommended Posts

Although spaces in file names are considered a bad thing on the internet, osc allows you to upload an image whose name contains spaces and uses that name for the online version, without any apparent problems.

However I have noticed that recently they have started throwing up errors in google webmaster tools. g has said for a long time that they consider image names containing spaces to be invalid and that it could prevent products showing in g shopping results. The actual error thrown up is weird - it reports as a redirect error, and shows the problem url as the image name up to the first space.

Fortunately the fix is simple - you just need to edit the tep_image function in catalog/includes/functions/html_output.php to make sure that any spaces are converted to %20:

strtr(tep_output_string($src),array(' ' => '%20'))

instead of

tep_output_string($src)

Of course, avoiding spaces in the names in the first place is a good idea too.


For a new install or if your store isn't mobile-friendly, get the community-supported responsive osCommerce (Phoenix).

here: on the official osc download page

Working on generalising bespoke solutions for Quickbooks integration, Easify integration and pay4later (DEKO) integration at 2.3.x

Share this post


Link to post
Share on other sites

×