Skip to content

Commit

Permalink
Merge branch 'MDL-67030' of https://github.com/stronk7/moodle
Browse files Browse the repository at this point in the history
  • Loading branch information
snake committed Nov 21, 2019
2 parents 88b2d7b + 30e5aca commit 6f407fb
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/htmlpurifier/HTMLPurifier/ChildDef/Custom.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public function __construct($dtd_regex)
protected function _compileRegex()
{
$raw = str_replace(' ', '', $this->dtd_regex);
if ($raw{0} != '(') {
if ($raw[0] != '(') {
$raw = "($raw)";
}
$el = '[#a-zA-Z0-9_.-]+';
Expand Down
2 changes: 1 addition & 1 deletion lib/htmlpurifier/HTMLPurifier/Encoder.php
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ public static function cleanUTF8($str, $force_php = false)

$len = strlen($str);
for ($i = 0; $i < $len; $i++) {
$in = ord($str{$i});
$in = ord($str[$i]);
$char .= $str[$i]; // append byte to char
if (0 == $mState) {
// When mState is zero we expect either a US-ASCII character
Expand Down
2 changes: 1 addition & 1 deletion lib/htmlpurifier/HTMLPurifier/TagTransform/Font.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public function transform($tag, $config, $context)
if (isset($attr['size'])) {
// normalize large numbers
if ($attr['size'] !== '') {
if ($attr['size']{0} == '+' || $attr['size']{0} == '-') {
if ($attr['size'][0] == '+' || $attr['size'][0] == '-') {
$size = (int)$attr['size'];
if ($size < -2) {
$attr['size'] = '-2';
Expand Down
3 changes: 3 additions & 0 deletions lib/htmlpurifier/readme_moodle.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,8 @@ Description of HTML Purifier v4.10.0 library import into Moodle
* add this readme_moodle.txt to /lib/htmlpurifier/

Modifications:
(verify if we need to apply them on every upgrade, remove when not needed)
* MDL-60337 use correct IDN variant for converting domain names to ascii
Check status of https://github.com/ezyang/htmlpurifier/pull/148
* MDL-67030 applied https://github.com/ezyang/htmlpurifier/pull/224 towards
php74 compatibility.

0 comments on commit 6f407fb

Please sign in to comment.