MDL-65308 core: change a couple of unsafe preg_quote() cases
authorEloy Lafuente (stronk7) <stronk7@moodle.org>
Tue, 9 Apr 2019 01:13:57 +0000 (03:13 +0200)
committerEloy Lafuente (stronk7) <stronk7@moodle.org>
Mon, 15 Apr 2019 23:40:47 +0000 (01:40 +0200)
commit0b9d7d93f8068621522520ce9bb1599f3d0e04ab
treebda9301e43854aef01fd65650950911359fb834d
parentbef0fe2000e332402c572b6fe9d0e20b5b31133a
MDL-65308 core: change a couple of unsafe preg_quote() cases

With PHP 7.3, the hash (#) is being escaped by preg_quote().

While normally that doesnt have much impact and normal operations
continue working perfectly... when the results of the function are
used to match against the same string... they don't match anymore.

Have found a couple of there double-uses in core and this
commit fixes them. Covered with tests.
backup/util/helper/restore_log_rule.class.php
backup/util/helper/tests/restore_log_rule_test.php
mod/lesson/pagetypes/shortanswer.php