We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Files with brackets in their name not being encoded properly in 2.7

Developer Preview

DigitalDoctors's avatar
DigitalDoctors
76 posts
12 years ago
DigitalDoctors's avatar DigitalDoctors

Hi team,

Another encoding bug.

I have a client whom due to their re sizing tool of choice has file names like ‘Andys_Photo_(Small).jpg’.

When uploading this image and publishing the channel entry it works fine.

After going back to edit this file it looks fine however on subsequent edits the file name is pre-pended by the file dir id eg {filedir_x}Andys_Photo_(Small).jpg then {filedir_x}{filedir_x}Andys_Photo_(Small).jpg and so on.

Every subsequent save the filedir id keeps having another copy of itself pre-pended.

Testing thus far with images with brackets in their name eg. “(” and “)”

Other 2.7 install - Does the same thing

2.6.1 install - Works fine

Upgraded this install to latest 2.7 preview and had more problems which seemingly would have been solved by the unset’s in this post (I assume this fix isnt in the dev preview yet). However my initial problem persisted so I downgraded again so I just have the one bug to squash.

Thanks for your time here guys

       
Kevin Cupp's avatar
Kevin Cupp
791 posts
12 years ago
Kevin Cupp's avatar Kevin Cupp

Hi DigitalDoctors, could you try applying this fix?

Open system/expressionengine/libraries/File_field.php

ADD this code below line 465 near the beginning of the get_file function:

// URL-decode the reference bfore searching or querying
$file_reference = rawurldecode($file_reference);

Let us know how that works. Thanks for reporting this!

Kevin

       
DigitalDoctors's avatar
DigitalDoctors
76 posts
12 years ago
DigitalDoctors's avatar DigitalDoctors

Bingo, thanks guys!

Appreciate the quick turn around on squashing the bugs.

Hopefully we aren’t to far away from a stable 2.7

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.