1
0
Commit Graph

176 Commits

Author SHA1 Message Date
9b758e84db fix: Show proper upload media popup when using filter after upload
Add the needed parameters to the hidden form used in the media library form so that a reload of the ML after the first upload still crenders the correct ML variant - the one for selecting an image, not the generic
2021-05-13 21:26:58 +02:00
e448d1c384 php 8 compat for ML item insert into article 2021-05-13 20:16:21 +02:00
d28b15381c php 8 compat fixes for ML directory section 2021-05-13 14:57:19 +02:00
561a86b385 php 8 compat fixes for media property page 2021-05-13 14:43:55 +02:00
c00ed46789 fix: media upload fails when in subdirectory with default paths
Use file['realfile'] instead of path guessing based on file['full_file'] to access image on disk, since file['full_file'] is based on the http path
2021-05-13 14:18:31 +02:00
05c3fa71eb Revert "fix: uploaded image path computted wrong when in subdirectory"
This reverts commit 46e8cc96b3.
2021-05-13 14:16:21 +02:00
4cab1db38d php 8 compat: Image upload 2021-05-13 14:13:58 +02:00
46e8cc96b3 fix: uploaded image path computted wrong when in subdirectory
The path set as $file['full_file'] and used for the dimension calculation incorrectly used the HTTP path
2021-05-13 14:11:07 +02:00
a6ca0d7fe5 PHP8 compat fixes for media library 2021-05-06 20:45:19 +02:00
cb258fa3a8 PHP8 compat fixes for image upload menu 2021-05-06 20:45:19 +02:00
db08637624 Improve performance of the media library by caching the file list 2020-08-01 20:36:23 +02:00
3d975cd562 syntax fixes, if without brackets 2020-06-06 01:51:25 +02:00
6036d62d82 media: added option to disable multiselection (still on by default) 2020-06-04 23:51:13 +02:00
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