5510 Commits

Author SHA1 Message Date
Hanno Böck
507ede701a Simplify cookie option code and set security flags httponly and samesite=Lax.
Include compatibility code for pre-7.3 PHP versions.
2020-04-24 20:35:52 +02:00
Thomas Hochstein
e60dd8dd2d
Merge pull request #702 from th-h/thh-plugin-comments
[plugin_comments] Don't strip HTML unconditionally.
2020-04-24 15:25:40 +02:00
Thomas Hochstein
a80a57b780 [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:24:10 +02:00
Thomas Hochstein
9cff057209 CK-Editor: allow details and summary.
Signed-off-by: Thomas Hochstein <thh@inter.net>
2020-04-23 17:56:54 +02:00
stephanbrunker
928f220c5a [event nl2br] fix concatenation and spaces between newlines 2020-04-23 00:05:22 +02:00
Thomas Hochstein
c694fb0f45 Fix regexp to truncate media extensińs to 5 chars.
See 4ee1066b8996bada7f2e0beea5e8474ccb579ba2
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
Thomas Hochstein
b2b1de66b6
Merge pull request #695 from th-h/thh-fixentryprop
Fix accidental deletion of extended properties.
2020-04-18 22:41:26 +02:00
Thomas Hochstein
f32be57fb5 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.

Signed-off-by: Thomas Hochstein <thh@inter.net>
2020-04-18 22:33:20 +02:00
Stephan Brunker
a3f39396c6 [event_spamblock] Don't refresh timeout when displaying preview 2020-04-14 14:07:02 +02:00
Stephan Brunker
0d7f55e616 fix oddments in admin/users and admin/entries 2020-04-14 13:56:45 +02:00
Thomas Hochstein
bb021db228 Add note to serendipity_event_spartacus.php.
See #685.

Plugin version not incremented on purpose.

Signed-off-by: Thomas Hochstein <thh@inter.net>
2020-04-11 12:56:42 +02:00
Thomas Hochstein
9b65e717c1 Add note to serendipity_fetchEntries().
I think that will help to think about the
context of serendipity_fetchEntries() calls.

Closes #693.

Signed-off-by: Thomas Hochstein <thh@inter.net>
2020-04-11 12:53:09 +02:00
Thomas Hochstein
93ba22c8d4 Don't fallback to last page if $totalPages < 1.
See #693 for context. That should at least
avoid SQL errors.

Signed-off-by: Thomas Hochstein <thh@inter.net>
2020-04-11 12:47:55 +02:00
Thomas Hochstein
6522f043cf
Merge pull request #694 from th-h/master
Fix SQL error in plugin_history.
2020-04-11 10:58:29 +02:00
Thomas Hochstein
4010d57d28 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.

Signed-off-by: Thomas Hochstein <thh@inter.net>
2020-04-11 10:52:50 +02:00
Stephan Brunker
aff7f2ed9c functions_entries: use rewriteURL function for comment submit link 2020-04-06 19:36:10 +02:00
Thomas Hochstein
e288d7e43e Fix display of upgrade notification.
Signed-off-by: Thomas Hochstein <thh@inter.net>
2020-04-03 09:15:33 +02:00
Thomas Hochstein
0fc509a50b Add NEWS item.
Signed-off-by: Thomas Hochstein <thh@inter.net>
2020-03-28 15:22:58 +01:00
Thomas Hochstein
c89d7f92f6 Dashboard: Merge s9y and plugin update notifications.
Display either or both in one section.

Set dashboard_widget class to aid formatting.

Signed-off-by: Thomas Hochstein <thh@inter.net>
2020-03-28 15:22:58 +01:00
Thomas Hochstein
5ca9da9a56 [event_spartacus] Change dashboard upgrade notification to simple link.
Signed-off-by: Thomas Hochstein <thh@inter.net>
2020-03-28 15:22:58 +01:00
onli
de29be7287 Drop unused is_utf8 variable 2020-03-28 13:37:12 +01:00
onli
b718cf7726 Only set mysqli_set_charset when covnersion is enabled
This restores the behaviour from before the move to utf8mb4 and should help legacy blogs not having charset issues, that went from latin1 to utf8 to now utf8mb4
2020-03-28 13:31:49 +01:00
Thomas Hochstein
261bac42f1 Bump event_spartacus version
Signed-off-by: Thomas Hochstein <thh@inter.net>
2020-03-28 13:26:06 +01:00
Thomas Hochstein
53694e2691 Unconditionally keep upgraded_version in plugin cache.
See #685 for more information.

Signed-off-by: Thomas Hochstein <thh@inter.net>
2020-03-28 13:22:01 +01:00
Thomas Hochstein
ded855f096 [event_spartacus] Simplify count_plugin_upgrades()
Signed-off-by: Thomas Hochstein <thh@inter.net>
2020-03-28 13:21:09 +01:00
Thomas Hochstein
52952ffe36 Fix comment in plugin_api.inc.php
Signed-off-by: Thomas Hochstein <thh@inter.net>
2020-03-28 09:24:30 +01:00
Thomas Hochstein
5adf3cda02 One adv_opts_box should be enough for everybody.
Signed-off-by: Thomas Hochstein <thh@inter.net>
2020-03-27 20:18:46 +01:00
Thomas Hochstein
bb02319553 Fix regexp in
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-03-27 16:47:49 +01:00
Stephan Brunker
2bbf459118 admin template entrylist: entry title was double escaped 2020-03-26 11:08:33 +01:00
onli
51448ddcae Prevent header already sent error for serendipity_editor.js.tpl 2020-03-25 23:49:10 +01:00
onli
d690a751d3 Up spamblock version, document #683 2020-03-25 22:33:19 +01:00
Daniel Lange
57cbaaa58b Update spamblock query to work in MySQL 5.7+ with default "strict" mode
The old query will fail with ONLY_FULL_GROUP_BY set which is default from
MySQL 5.7.5 onwards. This results in the .htaccess file not being updated.

Also adding some fencing to the foreach to prevent php error messages.
2020-03-25 22:28:25 +01:00
Thomas Hochstein
7bd1f3567e Add NEWS item.
Signed-off-by: Thomas Hochstein <thh@inter.net>
2020-03-25 21:48:27 +01:00
Thomas Hochstein
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
Thomas Hochstein
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
Thomas Hochstein
3148e44f87 Release 2.3.4
Signed-off-by: Thomas Hochstein <thh@inter.net>
2020-03-25 16:59:24 +01:00
Thomas Hochstein
7ca42f379f Fix typo (ML renaming code).
Fixes 2ccb43a271a41eba90fba1bacc46965f8323437f

Signed-off-by: Thomas Hochstein <thh@inter.net>
2020-03-25 16:23:21 +01:00
Thomas Hochstein
382c785725 Merge branch 'thh-rce'
* thh-rce:
  Fix RCE vulnerability on Windows.
  Add missing active content check for renaming.
2020-03-25 16:13:39 +01:00
Thomas Hochstein
fd8dcd3882 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:36:08 +01:00
Thomas Hochstein
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
Thomas Hochstein
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
Thomas Hochstein
0b2d6bf931 Really set source of plugins.
Fixes d179f1b1540768eb13e75795457822e6477541cc

Signed-off-by: Thomas Hochstein <thh@inter.net>
2020-03-25 15:03:31 +01:00
Thomas Hochstein
90be45004b Add NEWS entry for ML rename fixes.
Signed-off-by: Thomas Hochstein <thh@inter.net>
2020-03-25 13:16:41 +01:00
Thomas Hochstein
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
Thomas Hochstein
fd49846aa1 Add different error messages for ML rename.
Signed-off-by: Thomas Hochstein <thh@inter.net>
2020-03-25 13:06:33 +01:00
Thomas Hochstein
837c58cf6d Add missing en/UTF-8 entries to language file.
Belongs to
d179f1b1540768eb13e75795457822e6477541cc

Signed-off-by: Thomas Hochstein <thh@inter.net>
2020-03-25 11:04:06 +01:00
Thomas Hochstein
ce7fa80f4b Add filename to error message (ML renaming).
Belongs to
1c95c173a22e15fa22b21d3466b8e5cc9e626645

Signed-off-by: Thomas Hochstein <thh@inter.net>
2020-03-25 11:04:00 +01:00
Thomas Hochstein
18ab57b76b ML: Really add error message when renaming fails.
Fixes 1c95c173a22e15fa22b21d3466b8e5cc9e626645
2020-03-25 11:03:34 +01:00
Thomas Hochstein
1c95c173a2 ML: Add error message when renaming fails.
Completing 1ed4b9e7eca2a0c371582a454c232c

As we already have an (unused) language
constant for this error, we seem to have
had this kind of check before ...

Signed-off-by: Thomas Hochstein <thh@inter.net>
2020-03-25 00:54:48 +01:00
Thomas Hochstein
b12c098bd0 Add author to details of installed plugins.
Signed-off-by: Thomas Hochstein <thh@inter.net>
2020-03-24 16:12:31 +01:00