18 Commits

Author SHA1 Message Date
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
8ba4e5a3d2 MDL-73433 core: all methods in core_text can accept null argument 2022-09-29 21:06:22 +02:00
Eloy Lafuente (stronk7)
2def80568b MDL-74097 core_text: Ensure that transliteration always happens
Before the patch, transliteration was only happening when the
encoding of the string was utf-8. For other encodings only a
simpler conversion (iconv) to ascii was done. For some reason
iconv() own transliteration abilities are not consistent
between systems (depends of libraries installed, locales and
other bits).

So now we always convert the string to utf-8, in order to
transliterate it. And finally, also perform an iconv to
cover some characters that transliterate doesn't handle ok.

Also, remove a block of code that does nothing (previously
it was executing some code, but now it just sets and restores
the error level for nothing).
2022-03-08 10:37:47 +01:00
Leon Stringer
22825647d4 MDL-72035 csvlib: Write BOM for Excel
Add option to class csv_export_writer to prefix CSV file with UTF-8 byte
order mark (BOM).  This helps Microsoft Excel detect the file's character
encoding.
2021-06-30 15:04:16 +01:00
Peter Dias
d1c978c33c MDL-53544 core: Performance update is_charset_supported 2021-05-27 10:25:08 +08:00
Peter Dias
36c64105a7 MDL-53544 lib: Remove typo3 from text.php 2021-05-26 16:46:30 +08:00
Eloy Lafuente (stronk7)
88d29a1bb8 MDL-66965 core: php74 curly 2 square braces changes
Note this only modified core files, still there are a lot
of curly brace uses but all them are within 3rd part
libraries and will be handled apart.
2019-10-25 17:41:10 +02:00
sam marshall
ffa868a9e1 MDL-62042 core_search: Unicode non-characters cause indexing problems
Unicode characters such as U+FFEF can be entered into Moodle data and
cause indexing failures. This change strips them out of search fields.
2018-04-19 16:54:47 +01:00
Marina Glancy
484b43f456 MDL-60281 general: create_function is deprecated in PHP7.2 2017-10-16 09:37:19 +08:00
Andrew Nicols
13659515fd MDL-55326 core_text: Correct typo3 file permissions 2017-03-27 15:07:01 +08:00
Eric Merrill
08c21a1beb MDL-53273 search: Use unicode safe string truncation 2016-03-06 13:32:59 -05:00
Nadav Kavalerchik
cdf8a0c262 MDL-19270 - Quiz graph - Fix reverse display of Hebrew legend text in RTL mode 2014-07-06 18:46:45 +03:00
Sam Hemelryk
78c12cdb0f MDL-43365 lib: converted text and plugin deprecated classes to new scheme
Four core library classes renamed for autoloading with deprecated stubs
have been converted to the new scheme for autoloading.
They are:

 * textlib
 * collatorlib
 * plugin_manager
 * plugininfo_base

These will be removed in 2.9 by MDL-46124
2014-06-25 09:30:38 +12:00
Tim Hunt
5bcfd504df MDL-45618 Fix @since PHPdoc tags. 2014-05-19 17:03:04 +01:00
Petr Škoda
e734d8850c MDL-41197 normalize ascii text conversion 2013-10-07 23:54:05 +02:00
Petr Škoda
ef5e1151c1 MDL-41197 ignore all problems when converting texts 2013-10-04 10:59:41 +02:00
Frederic Massart
aa87fe80b3 MDL-40877 core_text: Added UTF-8 safe strrchr method 2013-08-16 10:58:22 +08:00
Petr Škoda
d534708fd3 MDL-40299 textlib conversion to core_text and core_collator 2013-06-27 22:18:57 +02:00