Characters in file name stripped/changed

  • Posts: 274
  • Thank you received: 5
  • Hikashop Business
9 years 5 months ago #233603

-- HikaShop version -- : 2.6.1
-- Joomla version -- : 3.4.8

Hi there, we have discovered that certain characters in file names are changed/stripped when uploaded. For example in the file name a01-000#product_name#it#sds.pdf the # characters are replaced by underscore. How can we stop this from happening?

Please Log in or Create an account to join the conversation.

  • Posts: 4820
  • Thank you received: 654
  • MODERATOR
9 years 5 months ago #233609

Hello,

Some Css code can make the job, you can learn with this link , you will find a tutorial that explain how reach your Css file and create a custom Css.
Once, you have understand where you can add your Css code, use this kind of code.

A little advice, put your custom code at the end of your frontend_custom.css, that will be more easy later to find and maybe correct it

Hope this will help you.

regards,

Please Log in or Create an account to join the conversation.

  • Posts: 274
  • Thank you received: 5
  • Hikashop Business
9 years 5 months ago #233651

Hi Philip,

I am nout sure your reply answers my question. I have read about the custom css. but I cannot find anything about how to stop characters in file names being stripped out when upload as attachment to products. I have tested again and the '#' are completely stripped out of file name when uploaded.

Thanks, James

Please Log in or Create an account to join the conversation.

  • Posts: 84307
  • Thank you received: 13701
  • MODERATOR
9 years 5 months ago #233690

Hi,

It seems Philippe didn't understand your message.

It's normal that the # characters are removed. It comes from a security feature of Joomla for the upload of files.
You would have to change the line:

$regex = array('#(\.){2,}#', '#[^A-Za-z0-9\.\_\- ]#', '#^\.#');
to:
$regex = array('#(\.){2,}#', '#[^A-Za-z\#0-9\.\_\- ]#', '#^\.#');
in the file libraries/joomla/filesystem/file.php to avoid that but I don't recommend doing it. Instead, just use another character like - or _ as separator if you can

The following user(s) said Thank You: jameswadsworth

Please Log in or Create an account to join the conversation.

  • Posts: 274
  • Thank you received: 5
  • Hikashop Business
9 years 5 months ago #233831

Hi Nicolas, thank you for your answer. As a work around we can load the files though ftp to the server then create manually the files with the links. We did briefly think about overriding the core file class

[url=http://https://gist.github.com/dongilbert/3237387]https://gist.github.com/dongilbert/3237387[/url]

but thought better of it!! ;)

Last edit: 9 years 5 months ago by jameswadsworth.

Please Log in or Create an account to join the conversation.

Time to create page: 0.058 seconds
Powered by Kunena Forum