Commit Graph

27 Commits

Author SHA1 Message Date
Paul Holden
bb0085e1d9 MDL-76725 mod_wiki: avoid named arguments in real path callback.
See also f4fb91ae. PHP8 now supports named arguments in calls to
the `call_user_func_array` method, which can result in differing
behaviour compared to PHP7, e.g. in this case it was throwing an
exception due to an unknown named parameter.
2023-01-04 14:08:20 +00:00
Marina Glancy
a800e7e62f MDL-74853 various: add second parameter to htmlentities functions
Default value of the $flag argument changed in PHP 8.1 from ENT_COMPAT to ENT_QUOTES | ENT_SUBSTITUTE
To ensure consistent behavior across different PHP version the second parameter is now required for the functions:
htmlspecialchars(), htmlentities(), htmlspecialchars_decode(), html_entity_decode() and get_html_translation_table()
2022-11-28 16:12:20 +01:00
Marina Glancy
ac7c952b84 MDL-73435 mod_wiki: htmlspecialchars changed default in PHP8.1 2022-04-29 16:22:43 +02:00
Eloy Lafuente (stronk7)
fdc2dcf264 MDL-72871 cleanup: Remove incorrect whitespace from codebase
Differences can be checked with git diff --ignore-all-space and
that will show that the only non-whitespace change is in a test
in the git lib/tests/html2text_test.php file. In that case the
whitespace has been replaced by a quoted string (of whitespaces)
keeping the test 100% equivalent and workarrounding the whitespace.
2021-10-26 17:19:11 +02:00
David Mudrák
59641dd5a6 MDL-68738 wiki: Prevent URLs inside links from turning into another link
There was a problem with wiki pages in the HTML markup syntax. If they
contain a link and the link text has a URL in it, that URL was converted
into another link. But it was not correctly nested and it caused
additional troubles with filters (particularly the multimedia filter if
the URL was a video such as on youtube).

The solution here is similar to what we do in filters. We protect the
whole explicit link so that its content is not further parsed. That
prevents the inner URL to be converted into another link and the
explicit link has the full control.
2020-05-21 21:12:02 +02:00
Eloy Lafuente (stronk7)
a5e3c4e5f3 MDL-67438 wiki: Formating changes (file doc block + whitespace fixes)
Also:
- change 2 variable/property names, both internal.
- format empty function.

Towards getting it fully phpcs compliant. Note this does not
fix the missing (in all methods) phpdoc blocks.
2020-01-17 12:34:30 +01:00
Andrew Nicols
e3bc4eb7a9 MDL-67114 mod_wiki: Whitespace fix 2020-01-07 11:04:41 +08:00
Eloy Lafuente (stronk7)
4621917c62 MDL-67114 core: php74 fix. Fix use of scalar as array in core
There are various places where it's not guaranteed that the
variable being used is array, and instead, can be null, bool, int...

We need to check that because php74 warns about it.

Where possible we have used the coalesce operator as
replacement for isset() ternary operations.
2020-01-03 11:33:15 +01:00
Eloy Lafuente (stronk7)
8eb8e5df83 Merge branch 'MDL-48307-master' of git://github.com/marinaglancy/moodle 2016-03-22 00:28:02 +01:00
Marina Glancy
7c5c80350c MDL-49807 mod_wiki: section detection regexp fix 2016-02-17 13:11:10 +08:00
Marina Glancy
aaa6bcb61a MDL-48307 mod_wiki: protect [edit] section link from nwiki parser 2016-02-10 14:23:57 +08:00
Marina Glancy
3d89ccb374 MDL-49807 mod_wiki: minimum heading level should always be <h3> 2016-02-09 17:48:39 +08:00
Luca Bösch
2c13bbba2b MDL-37739 mod_wiki: Wiki ToC header href remove square double brackets.
When H1, H2 and H3 links in wiki act themselves as hyperlinks, they
were displayed in double brackets. This patch removes [[ and ]] out of
the table of content displayed header hyperlinks.
2016-01-19 09:00:56 +01:00
Frederic Massart
414f7ef8ff MDL-29585 mod_wiki: Prevent broken links in editable sections
When a section name ended with a URL, the '<a' part of [edit] link
that is appended to the section was considered as part of the URL
in the section, thus causing the [edit] link to be broken.
2014-11-19 17:28:36 +08:00
Frederic Massart
c159e2aa0a MDL-29585 mod_wiki: Handle special characters in headings/sections 2014-11-17 10:38:36 +08:00
Sam Hemelryk
593b838546 MDL-44159 mod_wiki: unify @package use 2014-02-21 08:32:58 +13:00
Marina Glancy
20dff4b97e MDL-42400 mod_wiki: data generator for wiki 2013-10-26 14:00:27 +11:00
Petr Škoda
1a4596e434 MDL-29442 add missing utf-8 to entity html encoding and decoding 2012-12-09 18:21:38 +01:00
Charles Fulton
b4de35e632 MDL-28616 wiki: use class variable for toc header depth 2012-09-14 05:49:14 -07:00
Charles Fulton
2264828fd0 MDL-28616 wiki: html format toc rendering should match nwiki and creole 2012-09-14 05:49:14 -07:00
Charles Fulton
789379ec58 MDL-32023 wiki: remove hard-coded edit string 2012-08-02 06:08:49 -07:00
Sun Zhigang
a572f17d41 MDL-31201 wiki: fix a hardcoded string 2012-06-27 13:34:50 +08:00
Aparup Banerjee
2b9ce62e23 performance MDL-25637 converted tabs to spaces 2011-01-24 15:49:18 +08:00
Aparup Banerjee
f179cdb73e performance MDL-25637 some of more similar performance tweaks to come 2011-01-24 14:51:21 +08:00
David Mudrak
84a8bedd6a MDL-24777 function replace_smilies() is not called from any other core code 2010-10-23 18:41:47 +00:00
Jonathan Harker
349565d0c1 mod/wiki: MDL-20876 fix deprecated split() calls. 2010-07-20 01:43:11 +00:00
Dongsheng Cai
00710f4cc1 MDL-22112, push wiki 2.0 into head 2010-05-02 11:28:11 +00:00