1
0
Commit Graph

163 Commits

Author SHA1 Message Date
c694fb0f45 Fix regexp to truncate media extensińs to 5 chars.
See 4ee1066b89
and https://gist.github.com/mmitch/5b466e6f89efc6dccd7dce2cf7d72742

Thanks to @mmitch!

Signed-off-by: Thomas Hochstein <thh@inter.net>
2020-04-20 08:44:30 +02:00
4ee1066b89 Truncate extension of media items to 5 chars.
That's the max length of the extensin
database field.

Fixes #609.

Signed-off-by: Thomas Hochstein <thh@inter.net>
2020-03-25 21:46:05 +01:00
1b6840d98e Relax active content check for renaming.
We don't need to check against the filename
without extension, because it's only the
extension that may be problematic.

Signed-off-by: Thomas Hochstein <thh@inter.net>
2020-03-25 21:43:12 +01:00
7ca42f379f Fix typo (ML renaming code).
Fixes 2ccb43a271

Signed-off-by: Thomas Hochstein <thh@inter.net>
2020-03-25 16:23:21 +01:00
e792a8d913 Fix RCE vulnerability on Windows.
Steps to reproduce:

1) Upload a PHP script to the Media Libray,
   naming it "test" (or any other name
   without extension).
2) Rename it to "exploit.php." (trailing dot!)

On Linux, the file will be renamed to
"exploit.php..", which is safe and
cannot be exploited.

On Windows though, the file will be
renemad to "exploit.php" and is then
remotely executable by calling it
from "/uploads/exploit.php".

Thanks to Junyu Zhang <rgdz.eye@gmail.com>
for spotting this!

Signed-off-by: Thomas Hochstein <thh@inter.net>
2020-03-25 15:04:31 +01:00
21c3b0d83f Add missing active content check for renaming.
After fixing the other ML file renaming bugs,
it was now possible to rename a file without
extension into a file that *does* have an
extension - so we need to check against
active content.

Signed-off-by: Thomas Hochstein <thh@inter.net>
2020-03-25 15:04:25 +01:00
2ccb43a271 Fix for "disappearing" media files after renaming.
The renaming code added a dot '.' to the
filename on disk even if the file hat no
extension. Therefore, the file name on disk was
different from the name in the database,
triggering the database purging code on the
next ML display.

(serendipity_displayImageList() will delete
files from the database that don't exist
any longer on disk.)

This code won't add spurious dots for
empty extensions, keeping disk and
database in sync.

Signed-off-by: Thomas Hochstein <thh@inter.net>
2020-03-25 13:10:46 +01:00
fd49846aa1 Add different error messages for ML rename.
Signed-off-by: Thomas Hochstein <thh@inter.net>
2020-03-25 13:06:33 +01:00
1ed4b9e7ec Prevent renaming ML object into existing file.
When renaming objects in the Media Library,
s9y didn't check if a file with the same
name already exists, resulting in a file
name collision deleting both files from
the database _and_ from disk.

Add a check to avoid that.

An error message would be nice, too, but
that may be added later on.

Tested on s9y-stable test instance.

Signed-off-by: Thomas Hochstein <thh@inter.net>
2020-03-20 17:54:29 +01:00
ed778d7199 changed parameters order for implode() 2020-03-17 15:48:36 +01:00
bd70590359 init 2020-03-16 23:51:17 +01:00
27fd525706 fix: rotate image did not rotate all thumbnails 2019-10-10 23:41:52 +02:00
98261856db Preserve manual set image link when moving/renaming image (#509) 2019-02-10 13:44:14 +01:00
e3aaefd2e9 ML: Add mediaproperties on rename (#509) 2018-11-18 22:57:51 +01:00
732f1ae851 ML: Update links, not just thumbnail, when renaming images (#509) 2018-11-18 21:47:45 +01:00
0dc6f620c1 [BUGFIX] Fixes media library regression, references #509
Adds missing ACL renames
Missing trailing / when managing dirs
Fix typo that did not evaluate read/write properly
Add missing NEWS entries
2018-11-05 15:59:49 +01:00
fdb4428191 Restore backend_media_rename (#509) 2018-10-30 19:51:37 +01:00
58ed05f187 fix: missing variable orderkey was supposed to be a string 2018-09-13 14:49:15 +02:00
9d1fa83a39 Allow svgs in the media library (#529) 2018-06-14 22:14:04 +02:00
d3e6a3ee3a Fix non-variable matches class (#522) 2017-07-11 14:06:32 +02:00
bfeccabcdb Rework media library directory move
Initial motivation for this rework was to add support for the responsive thumbnnails (#474). But it also is a re-implementation instead of an enahncement of the existing code because the moveMediaDirectory function had grown into a mess. It was very hard to debug possible renaming bugs, like https://board.s9y.org/viewtopic.php?f=3&t=21185. This approach uses several small functions instead that can be combined and re-used.
2017-04-30 20:38:24 +02:00
2b5de12b38 Issue #437 2017-01-26 08:25:06 +01:00
7410465496 Improve accessibility of iconfont icons
Iconfont icons are of no value to screenreader users; in our case,
they get alternative text. By adding 'aria-hidden="true"' to the
<span> holding the iconfont icon, we avoid the screenreader trying
to announce the iconfont icon.
2016-10-26 11:29:25 +02:00
460b416b7c Make ML work with simplified fallback chain
See 8affa1126a
2016-07-29 00:16:37 +02:00
Ian
8da2f97d07 fix 227d115 missing another multiperm assignment 2016-02-04 13:52:35 +01:00
30982e446d Transform contextless strict/no-strict in ML
Follow up on d1baaf4983 and 7554623cff, also moving this to the extended filterset.
2016-01-15 02:18:34 +01:00
Ian
150d748c67 document note went into wrong line with 4a565a8 2015-10-30 17:05:36 +01:00
Ian
4a565a89da try catch mediaproperties thumb changing upload path only if in need 2015-10-30 16:50:40 +01:00
Ian
897337cb8e allow array items for SetCookie and now use a ML-Filter cookie
(We will have to decide before release, if we want to keep this, though.)
2015-10-29 12:08:33 +01:00
Ian
0905633810 fix f2f4855 2015-10-28 14:03:36 +01:00
Ian
1965d2d419 fix media.filter and media.sortorder param 2015-10-28 11:55:46 +01:00
Ian
f2f4855ed7 fix ML Filter doubled filename
References #356
Closes #369
2015-10-28 11:42:33 +01:00
Ian
d1baaf4983 better listen on toggle_dir and remember 2015-10-26 11:36:57 +01:00
Ian
52730e6b0e disable unused button generation
We may decide to keep this disabled or remove it completely later on
2015-10-26 10:18:50 +01:00
Ian
26d18490d4 avoid doubled GET token and fill form_hidden only in case default 2015-10-26 10:15:57 +01:00
Ian
a7732eeb81 minors 2015-10-20 13:24:50 +02:00
Ian
8fcf4cd652 fix commits renaming directories in 08c09d1 and 5be90fd 2015-10-17 19:27:58 +02:00
Ian
7801b33e35 fix 7554623 2015-10-15 19:11:45 +02:00
Ian
7554623cff Allow strict media directory selection by toggle filter 2015-10-15 18:43:01 +02:00
Ian
08c09d1d65 do not error on directoryEdit save submit 2015-10-12 10:27:08 +02:00
Ian
5be90fd7ea another breaking printf 2015-10-12 10:24:43 +02:00
Ian
2b9a008208 allow upload file real umlaut conversion and remove workaround 2015-10-07 09:37:44 +02:00
Ian
8c732e94ab some printf messages need to have the argument preprocessed
or change to echo with inner printf()

Before it broke like this:
`<span class="msg_notice"><span class="icon-info-circled"></span> <b>Größe von Vorsch.</span>
 ändern</b>` which is wrong
2015-10-06 16:23:40 +02:00
Ian
a9eb4be896 fix 7c21de8 re-add $ispOldFile 2015-10-06 10:27:41 +02:00
Ian
fdc7c089c2 umlaut conversion 2015-10-05 19:20:47 +02:00
Ian
2b610dc791 Add first and last pagination for entries and media items 2015-10-05 19:10:53 +02:00
Ian
7c21de8aa8 Allow bulk move ML items to Uploads Root too
Fixes many issues like for renaming files and subdir handling, database placements and other issues.
Structures case DIR, FILE and FILE vars for renaming, moving, select and replace.
Touches directoryEdit and mediaproperties related boundaries.
Adds better event messages, which fixes $ob_serendipity_moveMediaDirectory.
Extends and fixes media_items realname issues and changes the length of the item title to be as long as possible.
Added new constants to be executed to the lang files in near future, when some follow up commits have been added.
2015-10-05 18:19:09 +02:00
Ian
d7b1e7d23d minor whitespace and code cleanup
and a small github docnote fix
and added a todo for transforming a filename into a valid  upload path
2015-09-30 11:22:37 +02:00
Ian
9e49ecc8c3 remove to API 2015-09-23 17:49:23 +02:00
Ian
e1402db6cc remove trailing ampersand
plus minors in prep for bulkmove / rename enhancement
2015-09-23 17:21:38 +02:00