Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
mahara
mahara
Commits
cf77fc8f
Commit
cf77fc8f
authored
Nov 08, 2019
by
Robert Lyon
Committed by
Gerrit Code Review
Nov 08, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge "Bug 1851288: URL encode the . char in block title"
parents
4404d730
f4360be7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
0 deletions
+3
-0
htdocs/js/views.js
htdocs/js/views.js
+1
-0
htdocs/lib/view.php
htdocs/lib/view.php
+2
-0
No files found.
htdocs/js/views.js
View file @
cf77fc8f
...
...
@@ -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
(),
...
...
htdocs/lib/view.php
View file @
cf77fc8f
...
...
@@ -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
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment