Commit f4360be7 authored by Robert Lyon's avatar Robert Lyon

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: Robert Lyon's avatarRobert Lyon <robertl@catalyst.net.nz>
parent de17114b
......@@ -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(),
......
......@@ -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,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment