Albums module assumes all filenames only have one '.' in
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Pluck CMS |
Fix Committed
|
Low
|
Ben Linsey-Bloom |
Bug Description
This is a fairly minor thing that I spotted in:
pluck-4_
list($image_
This assumes all filenames only have one dot ('.') in. If a filename has multiple dots in, anything between the second and third dot is considered to be the extension ($ext). Anything following the third dot is dropped from the filename.
eg. 'my.image.name.jpg' becomes 'my.image' when saved on the server.
I propose that we use the PHP function pathinfo(), and replace this:
list($image_
with this:
$image_filename = pathinfo(
$ext = pathinfo(
Let me know what you think.
Related branches
- Anders G. Jørgensen: Approve
-
Diff: 72 lines (+14/-10)3 files modifieddata/inc/editpage.php (+8/-7)
data/inc/functions.admin.php (+4/-1)
data/inc/functions.all.php (+2/-2)
Changed in pluck-cms: | |
importance: | Undecided → Low |
A little further down the code where the file is checked if it already exists, the code needs to be fixed as well. Your proposed solution unfortunately only wors since PHP 5.2, when the PATHINFO_FILENAME constant was introduced.
My solution would be to user strrpos() to find the last ".".
I fixed it in lp:~uranium235/pluck-cms/pluck-cms