Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Spaces in image names


BrockleyJohn

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.

Contact me for work on updating existing stores - whether to Phoenix or the new osC when it's released.

Looking for a payment or shipping module? Maybe I've already done it.

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

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...