Commit Graph

510 Commits

Author SHA1 Message Date
Damien Regad 5f21556db6 Fix undefined array key warning 2023-09-27 11:42:27 +02:00
fiwswe 102528bd69
Fix style error 2023-09-15 00:08:15 +02:00
fiwswe 6c16a3a9aa Use str_starts_with/str_ends_with 2023-09-14 23:06:43 +02:00
Gerrit Uitslag 6547cfc745 use $auth instanceof AuthPlugin instead of not null check 2023-09-01 01:10:48 +02:00
Gerrit Uitslag 4dc42f7f53 unused items, phpdocs 2023-09-01 00:31:19 +02:00
Andreas Gohr d4f83172d9 code style: line breaks 2023-08-31 22:44:40 +02:00
Andreas Gohr 90fb952c4c code style: operator spacing 2023-08-31 22:38:07 +02:00
Andreas Gohr 62ad2d27a5 code style: control structure fixes 2023-08-31 22:22:22 +02:00
Andreas Gohr 4b230b99ca code style: indent fixes 2023-08-31 22:09:41 +02:00
Andreas Gohr f9a94e7839 deprecate ptln()
This method was used to ensure some basic readability in the created
HTML sources long before Firebug and later the builtin inspector tools
in browsers pretty printed the HTML for you. Today, this is no longer
needed.

This adds a custom rector rule to automatically change all occurances to
echo statements.
2023-08-31 20:46:13 +02:00
Andreas Gohr 7d34963b3e coding style: control flow line breaks 2023-08-31 15:04:10 +02:00
Andreas Gohr 177d6836e2 coding style: control flow whitespaces 2023-08-31 14:22:35 +02:00
Andreas Gohr dccd6b2bba coding style: function call spacing 2023-08-30 18:41:45 +02:00
Andreas Gohr d868eb89f1 codestyle adjustments: function declaration braces/spaces 2023-08-30 17:09:14 +02:00
Andreas Gohr c1482d1c08 codestyle adjustments: function argument spacing 2023-08-30 17:03:06 +02:00
Andreas Gohr 24870174d2 Apply rector fixes to the rest of inc 2023-08-29 19:42:15 +02:00
Andreas Gohr 64259528af removed outdated version check 2023-06-09 21:34:01 +02:00
Andreas Gohr bf8392eb68 use samesite=Lax cookie attribute #2849
Since this has been the default in Chrome for a while, no sideeffects
are to be expected.
2023-06-09 21:04:48 +02:00
Andreas Gohr 977aa967e5 updated repo links 2023-03-23 11:13:35 +01:00
Andreas Gohr a577fbc2fe Don't send notifications if no save happend.
A page save might not actually save a new revision. For example when no
changes were detected or a plugin cancelled the saving action. In that
case no notifications should be sent and the cache does not need any
updates.

Fixes #3871
2023-03-11 13:20:30 +01:00
Jyoti S c78754017d
Fix for PHP 8.1 Warning
I am running Dokuwiki Release 2022-07-31a "Igor" and I noticed the following variety of PHP logs generated:
[01-Feb-2023 07:21:37 Asia/Kolkata] PHP Warning:  Undefined array key "host" in /home/ekvastra/wiki.ekvastra.in/inc/common.php on line 1362
2023-02-02 11:04:23 +05:30
Andreas Gohr a46a37efcf avoid warning in formText when no text is given 2023-01-31 12:18:46 +01:00
Julian Jeggle 181adffeff Check if SE referrer url actually has a query part 2022-12-09 18:19:47 +01:00
Andreas Gohr ec34bb300b Update core code to make use of sexplode()
This makes use of our own explode mechanism everywhere were we expect a
fixed number of results.
2022-10-19 15:29:26 +02:00
Andreas Gohr 12dd3cbcf3 introduce sexplode() as a PHP8 safe explode()
We often have constructs like

list($foo, $bar) = explode(',', $input, 2);

In PHP8+ this will throw warnings when the explode returns fewer than 2
elements. Our code usually (always?) will anticipate missing elements so
the construct isn't really problematic.

The implementation here wraps the solution suggested at
https://stackoverflow.com/a/56971347 into a new utility function.

I anticipate that people might object to the function name. It was
chosen as a short form of "safe explode". This makes fixing the warning
easy by simply adding a single letter. I also find it slightly amusing
and would be open to change it to just sex() just for the fun of it.
2022-08-26 10:57:01 +02:00
Andreas Gohr 10f359ad04 Replace direct calls to strftime with dformat calls
This is in preparation for fixing #3573
2022-04-28 09:58:06 +02:00
Andreas Gohr e6c6ac5066
Merge pull request #3574 from splitbrain/php81
Some PHP 8.1 compatibility fixes
2022-01-22 09:10:37 +01:00
Gerrit Uitslag 79a2d7845d import classes, replace dbglog, simplify, remove unused statements, and other warnings from IntelliJ
update phpdocs,
rename dokuwiki/Ui/Draft to PageDraft
2022-01-06 00:59:00 +01:00
Andreas Gohr bf8f8509c5 guard against unset parameters
Many string function will throw a deprecation warning in PHP 8.1 when
null is passed. This adds a few guards in some of our methods (not all,
yet)
2022-01-01 13:24:13 +01:00
Andreas Gohr f7711f2b85 always use the same htmlspecialchars setup
defaults for htmlspecialchars change in PHP 8.1

All calls should always use our hsc() method to ensure comparability
(especially when testing)
2022-01-01 12:28:35 +01:00
Gerrit Uitslag 357931f346
Merge branch 'master' into revisionHandle3 2021-12-28 01:35:30 +01:00
Andreas Gohr a58fcbbc19 guard against unsert user name. fixes #3455 2021-12-26 05:51:29 +01:00
Andreas Gohr d70c006d43
Merge pull request #3270 from adakaleh/simplify_clientIP
Simplify clientIP() function
2021-12-20 21:21:13 +01:00
Andreas Gohr 22bbbaceb1
Merge pull request #3269 from adakaleh/clientIP_page_locking
Remove clientIP() verification from page locking
2021-12-20 21:18:26 +01:00
Satoshi Sahara 69f9b481a6 add dbg_deprecated() 2021-11-28 12:22:40 +09:00
Satoshi Sahara 3b813d4362 PHP8: check array key existence 2021-11-27 15:38:26 +09:00
Satoshi Sahara b24e9c4a65 implement PageFile class
PageFile class handles wiki text file and its change management for specific page, main part comes from `function saveWikiText()`.  This ensures and enables to use one **PageChangeLog** instance during a page save process among class methods and relevant plugins.
2021-11-27 12:25:26 +09:00
Satoshi Sahara bbb28b9ce3 remove goto-loop structure
plugin event handler should set correct changeType.
2021-11-27 11:11:44 +09:00
Satoshi Sahara 66f4cdd456 set current revision date 1sec before now for external deletion
in preparation for possible new page save
2021-11-24 19:25:56 +09:00
Satoshi Sahara 9c42b79db7 update saveWikiText()
allow plugin that provides alternative policy for handling external edits in changelog
2021-11-16 18:43:02 +09:00
Satoshi Sahara d5824ab982 rigorous COMMON_WIKIPAGE_SAVE
ignore wrong changes in id and file data caused by event handlers
2021-11-13 18:42:22 +09:00
Satoshi Sahara c71927663a new method ChangeLog::addLogEntry()
rewrite `detectExternalEdit()` in inc/common.php
2021-11-04 12:02:55 +09:00
Satoshi Sahara 5ec961365f set revInfo{'current'] when needed
do not set 'current' key in ChangeLog:getCurrentRevisionInfo(), instead set it during loop in Revision and Diff classes
2021-11-01 17:06:25 +09:00
Satoshi Sahara 7866d571c1 UnitTest of pageinfo(), saveWikiText()
ChangeLog creates early .change file, p_get_metadata() will get full  "meta_last_change" entry. The current key in the revinfo need to be excluded prior to p_set_metadata() call.
2021-10-24 15:52:34 +09:00
Satoshi Sahara 252acce3e5 coding style of functions using ChangeLog 2021-10-23 11:56:44 +09:00
Satoshi Sahara facfe25030 external edits in changelog for images 2021-09-14 22:14:35 +09:00
Damien Regad 056bf31f71 Fix various errors in PHPUnit tests on PHP 8 2021-02-06 01:19:58 +01:00
Damien Regad 98fe1ac905 Remove ! operator causing unit tests to fail 2021-01-27 08:28:57 +01:00
Damien Regad 357c9a39ce Fix undefined array keys when displaying images 2021-01-27 02:31:12 +01:00
Damien Regad c10f256a39 Fix Undefined array key "DOKU_PREFS" in common.php 2021-01-27 00:45:30 +01:00