1
0
Commit Graph

1535 Commits

Author SHA1 Message Date
906239faa1 Set hashtype = 2 when converting from MD5
Otherwise we'd end up with an attempt to authenticate with SHA1 against
BCRYPT that never succeeds, see
https://board.s9y.org/viewtopic.php?t=24720
2020-04-26 22:01:25 +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
0d7f55e616 fix oddments in admin/users and admin/entries 2020-04-14 13:56:45 +02:00
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
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
aff7f2ed9c functions_entries: use rewriteURL function for comment submit link 2020-04-06 19:36:10 +02:00
e288d7e43e Fix display of upgrade notification.
Signed-off-by: Thomas Hochstein <thh@inter.net>
2020-04-03 09:15:33 +02:00
de29be7287 Drop unused is_utf8 variable 2020-03-28 13:37:12 +01:00
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
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
52952ffe36 Fix comment in plugin_api.inc.php
Signed-off-by: Thomas Hochstein <thh@inter.net>
2020-03-28 09:24:30 +01:00
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
51448ddcae Prevent header already sent error for serendipity_editor.js.tpl 2020-03-25 23:49:10 +01: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
0b2d6bf931 Really set source of plugins.
Fixes d179f1b154

Signed-off-by: Thomas Hochstein <thh@inter.net>
2020-03-25 15:03:31 +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
18ab57b76b ML: Really add error message when renaming fails.
Fixes 1c95c173a2
2020-03-25 11:03:34 +01:00
1c95c173a2 ML: Add error message when renaming fails.
Completing 1ed4b9e7ec

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
b12c098bd0 Add author to details of installed plugins.
Signed-off-by: Thomas Hochstein <thh@inter.net>
2020-03-24 16:12:31 +01:00
d179f1b154 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.

Signed-off-by: Thomas Hochstein <thh@inter.net>
2020-03-24 15:57:48 +01:00
f576501737 Revert "Save remote plugin source when merging remote / local data."
This reverts commit 8c702769e4.

We can do this better.

Signed-off-by: Thomas Hochstein <thh@inter.net>
2020-03-24 15:36:49 +01:00
8c702769e4 Save remote plugin source when merging remote / local data.
When installing / updating plugins, plugin data
is fetched from Spartacus first; those plugins
will habe "Spartacus" as "pluginlocation".

Later on, information about installed plugins
is fetched from cache / database, overwriting
the previously fetched data for all installed
plugins. After that, "pluginlocation" is
"local" even for plugins that live on
Spartacus if they have been installed.

So we save "pluginlocation" data to a new
"pluginsource" field before merging /
overwriting so we can detect plugins that
are available on Spartacus.

This data is present in plugins.inc.tpl
and can be used there.

Signed-off-by: Thomas Hochstein <thh@inter.net>
2020-03-23 22:28:43 +01:00
8a1ab31a66 Remove utf8mb4_ready requirement from native -> utf8 upgrade 2020-03-23 17:25:04 +01:00
be422b5e83 Add maintenance tasK: native -> utf8, utf8 -> utf8mb4
Note: Native to utf8 will not work if the data in the database table is actually utf8! These are helper functions for during the alpha, to make testing easier, not tasks for the beta/stable
2020-03-23 17:15:56 +01:00
af036ca58d Add warning to upgrade task for utf8mb4 upgrade 2020-03-23 09:57:59 +01:00
a6f9ec1638 fix: don't ugprade only entries, but all our databases 2020-03-23 00:03:20 +01:00
945b73dc34 Use utf8mb4_unicode_ci instead of utf8mb4_general_ci in upgrade 2020-03-22 23:52:01 +01:00
c6800d5fc3 minor: explain serendipity_utf8mb4_ready in doccomment 2020-03-22 23:20:08 +01:00
3ac81b91ca Reworked version and function requirement for utf8mb4 (#394) 2020-03-22 23:13:15 +01:00
fa17e0709c Upgrade task to move utf8 mysql databases to utf8mb4 (#394) 2020-03-22 22:15:23 +01:00
8b27a56209 Raise mysql requirements for utf8mb4 to 5.7/10.0.2
utf8mb4 did not work on a test server with large prefix (=not 3000 byte index limit, only 1000) on Depian 9/mariadb 10.1.44, because the row format was not barracuda (by default?)
2020-03-22 20:44:11 +01:00
b15a453165 Use InnoDB and utf8mb4 on current mysql databases
For new installations only so far
2020-03-22 13:15:32 +01:00
b718637794 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 17:59:13 +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
137330fd5b Don't allow requesting an archive page that doesn't exist 2019-12-15 13:17:29 +01:00
756f520d71 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.
2019-12-15 13:16:28 +01:00
4d770c9cc6 [TASK] Adds ability to make plugins change the multi-media insertion gallery HTML 2019-12-03 15:50:51 +01:00
aa1f3b533d Fix category page title - strip_langs - 2019-11-02 14:20:18 +01:00
d75e311077 added event_hook multilingual_strip_langs to permalinks 2019-11-02 14:20:18 +01:00
5c4c11f0b4 fixing multilingual issues: display languages in native names and fix initialition point of plugins 2019-11-02 14:20:18 +01:00
b4f0b35a5d Merge pull request #650 from stephanbrunker/master
Fix a lot of single issues and overhaul the language settings
2019-10-17 13:46:06 +02:00
ea371f6a4e fixed requested changes, array processing of multilingual_stip_langs 2019-10-15 22:45:02 +02:00
5b35569e73 [BUGFIX] Fixes missing referenced variable when $_GET['serendipity'] is not an array
refs #642
refs #653
2019-10-15 14:03:34 +02:00