5401 Commits

Author SHA1 Message Date
Thomas Hochstein
05840cb189 [plugin_comments] Don't strip HTML unconditionally.
If serendipity_event_unstrip_tags is active, we
don't want to strip HTML tags from comments; we
want to keep and encode them with entities. So
we should do that here, too.

As the frontend_display hook - that is catched by
serendipity_event_unstrip_tags - is called quite
late, we have to skip the strip_tags() call
before truncatin the entry.

(I'm not sure why we first strip _all_ tags and
later on keep _some_ tags (that have already
been removed), but that's maybe because the
frontend_display hook may have re-added some
tags? Be it as it may, we do that for 14
years, so I don't want to change that now.)

Signed-off-by: Thomas Hochstein <thh@inter.net>
2020-04-24 15:35:13 +02:00
Thomas Hochstein
6c15c802d5 CK-Editor: allow details and summary.
Backported from master branch.

Signed-off-by: Thomas Hochstein <thh@inter.net>
2020-04-23 18:08:32 +02:00
Thomas Hochstein
62543dbd28 Fix accidental deletion of extended properties.
Was mostly fixed by 8b51c37b98 (see #261),
but which missed 03cc73d77e and the other
older code before the foreach() loop.
Later on, 7fe8d91bc2 did the check for
'propertyform' the wrong way around.

Cherry-picked from master branch.

1.41.4 has *not* been backported.

Signed-off-by: Thomas Hochstein <thh@inter.net>
2020-04-20 08:56:28 +02:00
Thomas Hochstein
ef1279fbec Fix SQL error in plugin_history.
Since merging #665 `serendipity_plugin_history`
breaks with a SQL error message on every archive
page but the first one; see #693 for reason
and context.

Unset `$serendipity['GET']['page']` before
calling `serendipity_fetchEntries()` (and
reset afterwards) to fix that. That's the
correct way, I think, as
`serendipity_fetchEntries()` is not called
in page context here.

Add a note to serendipity_fetchEntries()
about the problem with page context.

Also don't fallback to last page if
$totalPages < 1 in serendipity_fetchEntries()
That should at least avoid SQL errors.

Signed-off-by: Thomas Hochstein <thh@inter.net>
2020-04-20 08:56:28 +02:00
Stephan Brunker
c66451e203 Admin template entrylist: entry title was double escaped.
Cherry-picked from master.

Signed-off-by: Thomas Hochstein <thh@inter.net>
2020-04-20 08:56:14 +02:00
Thomas Hochstein
64b5d56e00 Unconditionally keep upgraded_version in plugin cache.
See #685 for more information.

Signed-off-by: Thomas Hochstein <thh@inter.net>
2020-04-20 08:54:25 +02:00
Thomas Hochstein
891b72574c Fix comment in plugin_api.inc.php
Signed-off-by: Thomas Hochstein <thh@inter.net>
2020-04-20 08:54:25 +02:00
Thomas Hochstein
6a8e9637f1 One adv_opts_box should be enough for everybody.
Signed-off-by: Thomas Hochstein <thh@inter.net>
2020-04-20 08:54:25 +02:00
Thomas Hochstein
b446e6333f Fix regexp in functions_routing.incx.php
See #655.

I don't understand the code either (I don't even see
where this code path belongs to - do we have a
facitlity to show comments "from ... to"?), but
the current regexp is obviously wrong, and the
one suggested by @hannob is obviously
(syntactically) correct, so it should be no
problem to change that.

Fixes #655.

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

Fixes #609.

Signed-off-by: Thomas Hochstein <thh@inter.net>
2020-04-20 08:54:24 +02:00
Thomas Hochstein
37a04ec0a9 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:48:51 +01:00
Thomas Hochstein
5340fe4507 After release preparations.
Signed-off-by: Thomas Hochstein <thh@inter.net>
2020-03-25 17:04:13 +01:00
Thomas Hochstein
b9037fb158 Release 2.3.4
Signed-off-by: Thomas Hochstein <thh@inter.net>
2.3.4
2020-03-25 16:58:28 +01:00
Thomas Hochstein
2b0f489e39 Release preparations.
Signed-off-by: Thomas Hochstein <thh@inter.net>
2020-03-25 16:56:40 +01:00
Thomas Hochstein
a2d7383c79 Fix typo (ML renaming code).
Fixes 2ccb43a271a41eba90fba1bacc46965f8323437f

Signed-off-by: Thomas Hochstein <thh@inter.net>
2020-03-25 16:23:54 +01:00
Thomas Hochstein
c7c6a08c10 Wordwrap overly long words in comments via CSS.
Very long words may overflow the dashboard_widget
boundary on backend start page otherwise.

Signed-off-by: Thomas Hochstein <thh@inter.net>
2020-03-25 15:37:42 +01:00
Thomas Hochstein
b0971b67e9 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:05:05 +01:00
Thomas Hochstein
b22d51fbc0 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:05:05 +01:00
Thomas Hochstein
3d4e6b8f65 Add NEWS entry for ML rename fixes.
Signed-off-by: Thomas Hochstein <thh@inter.net>
2020-03-25 15:05:05 +01:00
Thomas Hochstein
364dda8595 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 15:05:05 +01:00
Thomas Hochstein
0562dc0ca6 ML: Add error message when renaming fails.
Completing 1ed4b9e7eca2a0c371582a454c232c

Cherry-picked from master.

Signed-off-by: Thomas Hochstein <thh@inter.net>
2020-03-25 15:05:05 +01:00
Thomas Hochstein
9155a7b8a4 Add plugin source to list of plugins.
* plugin_api.inc.php:
  - Add static list of bundled plugins.
  - Add function to check if plugin is
    bundled.
* plugins.inc.php:
  - Set source of plugin
    (Spartacus, bundled or local).
* plugins.inc.tpl:
  - Display plugin source.
* Add language constants.

Add link to Spartacus for all plugins,
don't skip installed plugins.

Add author to details of installed plugins.

Cherry-picked from master.

Signed-off-by: Thomas Hochstein <thh@inter.net>
2020-03-25 15:05:05 +01:00
Thomas Hochstein
cb7819b4d9 "$cachedtype" was set twice.
"$cachedtype" is saved anayway before returning;
no need to set it here.

Signed-off-by: Thomas Hochstein <thh@inter.net>
2020-03-24 16:13:47 +01:00
Thomas Hochstein
a5f28d3eb0 Escape plugin author name in pluginlist.
Don't show HTML from author name field.

Cherry-picked from master branch.

Signed-off-by: Thomas Hochstein <thh@inter.net>
2020-03-23 17:51:36 +01:00
Thomas Hochstein
d4b1f7cd35 After release preparations.
Signed-off-by: Thomas Hochstein <thh@inter.net>
2020-03-22 09:54:34 +01:00
Thomas Hochstein
a32bcadd75 Release 2.3.3
Signed-off-by: Thomas Hochstein <thh@inter.net>
2.3.3
2020-03-22 09:49:51 +01:00
Thomas Hochstein
25931b33c7 Release preparations.
Signed-off-by: Thomas Hochstein <thh@inter.net>
2020-03-22 09:45:21 +01:00
Thomas Hochstein
c9a7a44334 Fix typo.
Signed-off-by: Thomas Hochstein <thh@inter.net>
2020-03-21 23:42:51 +01:00
Thomas Hochstein
d319b9677b Sort NEWS file.
Signed-off-by: Thomas Hochstein <thh@inter.net>
2020-03-21 23:13:08 +01:00
Thomas Hochstein
1632a172f3 Set empty limit to "" in serendipity_fetchEntries.
If $limit is empty(), no limit is set, so we can
set the LIMIT statement to "" to achieve the same.

But an empty() $limit can be "0", so the
generated SQL statement could end with "0"
instead of the LIMIT statement. We catch this
with forcing an empty() $limit to "".

Fixes #636.
(No matter that this shouldn't even happen.)

Signed-off-by: Thomas Hochstein <thh@inter.net>
2020-03-21 18:08:40 +01:00
Thomas Hochstein
95c71c36c9 [plugin_comments] Fix wordwrap at wound boundaries.
Add ChangeLog.

Signed-off-by: Thomas Hochstein <thh@inter.net>
2020-03-21 16:18:15 +01:00
Thomas Hochstein
9709592b7c Escape version string in update notifier.
Fixes #674.

Backported from master branch.

Signed-off-by: Thomas Hochstein <thh@inter.net>
2020-03-20 19:11:23 +01:00
Thomas Hochstein
307f1c3dad 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.

Cherry-picked from master branch.

Signed-off-by: Thomas Hochstein <thh@inter.net>
2020-03-20 17:56:29 +01:00
surrim
1f31fd19c3 Changed parameters order for implode().
Thanks to @surrim.

Cherry-picked from master branch.

Signed-off-by: Thomas Hochstein <thh@inter.net>
2020-03-20 16:55:22 +01:00
surrim
67aea1b623 Fix serendipity_killPath().
Cherry-picked from master.

Signed-off-by: Thomas Hochstein <thh@inter.net>
2020-03-20 16:53:37 +01:00
onli
d462580606 Fix trackback deletion from frontend, invalid referrer error
Was missing the token.

For context see https://board.s9y.org/viewtopic.php?f=10&t=24633

Cherry-picked from master branch.
2020-03-20 16:49:14 +01:00
Lothar Serra Mari
6accc81ad6 Don't allow requesting an archive page that doesn't exist
Cherry picked from master branch.

Signed-off-by: Thomas Hochstein <thh@inter.net>
2020-03-20 16:46:50 +01:00
Stephan Brunker
3bf067c6ea functions_routing.php: set action to empty when serving JS
genpage is called but no action given -
the default page was generated at every call.

Cherry-picked from master branch.

Signed-off-by: Thomas Hochstein <thh@inter.net>
2020-03-20 16:45:11 +01:00
onli
ac81762eaa Make use of the video tag for videos in the ML.
Cherry-picked from master branch.
2020-03-20 16:42:11 +01:00
onli
5934de7a4e Fix links in ML not going to item when no image.
Cherry-picked from master branch.
2020-03-20 16:29:48 +01:00
onli
89351eb77b Fix: Remember where you stored images last
Fixes #652.

Cherry-picked from master branch.

Signed-off-by: Thomas Hochstein <thh@inter.net>
2020-03-20 16:26:26 +01:00
Garvin Hicking
a45c545ee3 [TASK] Uses single-asset insertion when only one asset has been selected to be inserted
See #651.

Backported from master branch.

Signed-off-by: Thomas Hochstein <thh@inter.net>
2020-03-20 16:23:43 +01:00
Thomas Hochstein
d319ad16f1 Add "lower/upper roman" ordered list styles.
Add NEWS entry, bump version number.

Fixes #647.

Backported from master branch.

Signed-off-by: Thomas Hochstein <thh@inter.net>
2020-03-20 16:23:26 +01:00
Thomas Hochstein
66494fdbe3 Force positive values for fetchLimits.
The number of entries shown on the title
page and in the feed has to be at least "1",
as s9y can't cope with "0" or negative
values (and it shouldn't).

May be related to #636.

Backported from master.

Signed-off-by: Thomas Hochstein <thh@inter.net>
2020-03-20 16:23:05 +01:00
Garvin Hicking
cad25673cf [TASK] Adds ability to make plugins change the multi-media insertion gallery HTML 2019-12-03 15:54:24 +01:00
Garvin Hicking
4daa718362 [TASK] backport to 2.3 2019-12-03 15:52:05 +01:00
Garvin Hicking
a1677ff0eb [TASK] Backport to 2.3.3 2019-12-03 14:27:01 +01:00
Garvin Hicking
15bc67ce8d [TASK] Updates serendipity_event_mailer: Prepend body option, force sending mails, fixed striptag label 2019-12-03 14:26:43 +01:00
Thomas Hochstein
d7b4e93292 After release preparations.
Signed-off-by: Thomas Hochstein <thh@inter.net>
2019-10-16 09:49:27 +02:00
Thomas Hochstein
26c7f9af75 Release 2.3.2.
Signed-off-by: Thomas Hochstein <thh@inter.net>
2.3.2
2019-10-16 09:43:59 +02:00