Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
drupal-3421017
Manage
Activity
Members
Labels
Plan
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Issue forks
drupal-3421017
Commits
2dd6e4e0
Commit
2dd6e4e0
authored
16 years ago
by
Angie Byron
Browse files
Options
Downloads
Patches
Plain Diff
#242873
follow-up: Missed a couple files with drupal_set_title().
parent
0a0d530c
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
includes/batch.inc
+4
-4
4 additions, 4 deletions
includes/batch.inc
includes/form.inc
+5
-0
5 additions, 0 deletions
includes/form.inc
includes/path.inc
+7
-2
7 additions, 2 deletions
includes/path.inc
with
16 additions
and
6 deletions
includes/batch.inc
+
4
−
4
View file @
2dd6e4e0
...
...
@@ -80,10 +80,10 @@ function _batch_start() {
function
_batch_progress_page_js
()
{
$batch
=
batch_get
();
// The first batch set gets to set the page title
//
and the initialization and error messages
.
// The first batch set gets to set the page title
and the initialization and
//
error messages. Only safe strings should be passed in to batch_set()
.
$current_set
=
_batch_current_set
();
drupal_set_title
(
$current_set
[
'title'
]);
drupal_set_title
(
$current_set
[
'title'
]
,
PASS_THROUGH
);
drupal_add_js
(
'misc/progress.js'
,
'core'
,
'header'
,
FALSE
,
FALSE
);
$url
=
url
(
$batch
[
'url'
],
array
(
'query'
=>
array
(
'id'
=>
$batch
[
'id'
])));
...
...
@@ -126,7 +126,7 @@ function _batch_progress_page_nojs() {
$batch
=&
batch_get
();
$current_set
=
_batch_current_set
();
drupal_set_title
(
$current_set
[
'title'
]);
drupal_set_title
(
$current_set
[
'title'
]
,
PASS_THROUGH
);
$new_op
=
'do_nojs'
;
...
...
This diff is collapsed.
Click to expand it.
includes/form.inc
+
5
−
0
View file @
2dd6e4e0
...
...
@@ -2379,6 +2379,11 @@ function form_clean_id($id = NULL, $flush = FALSE) {
* batch_process();
* @endcode
*
* Note - if the batch 'title', 'init_message', 'progress_message',
* or 'error_message' could contain any user input, it is the responsibility of
* the code calling batch_set() to sanitize them first with a function like
* check_plain() or filter_xss().
*
* Sample batch operations:
* @code
* // Simple and artificial: load a node of a given type for a given user
...
...
This diff is collapsed.
Click to expand it.
includes/path.inc
+
7
−
2
View file @
2dd6e4e0
...
...
@@ -197,15 +197,20 @@ function drupal_get_title() {
* @param $title
* Optional string value to assign to the page title; or if set to NULL
* (default), leaves the current title unchanged.
* @param $output
* Optional flag - normally should be left as CHECK_PLAIN. Only set to
* PASS_THROUGH if you have already removed any possibly dangerous code
* from $title using a function like check_plain() or filter_xss(). With this
* flag the string will be passed through unchanged.
*
* @return
* The updated title of the current page.
*/
function
drupal_set_title
(
$title
=
NULL
)
{
function
drupal_set_title
(
$title
=
NULL
,
$output
=
CHECK_PLAIN
)
{
static
$stored_title
;
if
(
isset
(
$title
))
{
$stored_title
=
$title
;
$stored_title
=
(
$output
==
PASS_THROUGH
)
?
$title
:
check_plain
(
$title
)
;
}
return
$stored_title
;
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment