Commit bab0f2fc authored by Robert Lyon's avatar Robert Lyon
Browse files

Bug 1851288: URL encode the . char in block title



Along with the other special chars as we use it as an array key and
PHP changes . to _

behatnotneeded

Change-Id: I22125a539bb205b8e1bc036c4ceee995d19ffb73
Signed-off-by: default avatarRobert Lyon <robertl@catalyst.net.nz>
(cherry picked from commit f4360be7)
parent 3c4b2833
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -190,6 +190,7 @@
                var blockid = $(ev.currentTarget).data('blockid');
                var option = $(ev.currentTarget).data('option');
                var title = encodeURIComponent($('#instconf_title').val());
                title = title.replace(/\./g, "%2E"); // Deal with . in the title
                var isnew = $('#instconf_new').val() == '1' ? '1' : '0';
                var pd = {
                    'id': $('#viewid').val(),
+2 −0
Original line number Diff line number Diff line
@@ -2472,6 +2472,7 @@ class View {

        if (!empty($values['title'])) {
            $newtitle = hsc(urldecode($values['title']));
            $newtitle = preg_replace('/\%2E/', '.', $newtitle); // Deal with . in title
        }
        $currentblocktags = get_records_sql_assoc("SELECT id, tag FROM {tag} WHERE resourcetype = ? AND resourceid = ?", array('blocktype', $currentblock->id));
        // Set up a dummy block instance of new blocktype with the data we need
@@ -2538,6 +2539,7 @@ class View {

        safe_require('blocktype', 'placeholder');
        $oldtitle = hsc(urldecode($values['title']));
        $oldtitle = preg_replace('/\%2E/', '.', $oldtitle); // Deal with . in title
        // Set up a dummy block instance of new blocktype with the data we need
        // So we can get the initial display and configure form data
        $bi = new BlockInstance(0,