Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
ctools
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
drupal.org
ctools
Commits
ce8a4682
Commit
ce8a4682
authored
15 years ago
by
Earl Miles
Browse files
Options
Downloads
Patches
Plain Diff
#424290: Fix semi-invalid paths using extra slashes.
parent
508d5476
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
delegator/plugins/tasks/page.admin.inc
+15
-1
15 additions, 1 deletion
delegator/plugins/tasks/page.admin.inc
with
15 additions
and
1 deletion
delegator/plugins/tasks/page.admin.inc
+
15
−
1
View file @
ce8a4682
...
@@ -142,7 +142,13 @@ function delegator_page_menu(&$items, $task) {
...
@@ -142,7 +142,13 @@ function delegator_page_menu(&$items, $task) {
$load_arguments
=
array
(
$subtask_id
,
'%index'
);
$load_arguments
=
array
(
$subtask_id
,
'%index'
);
// Replace named placeholders with our own placeholder to load contexts.
// Replace named placeholders with our own placeholder to load contexts.
foreach
(
explode
(
'/'
,
$subtask
->
path
)
as
$position
=>
$bit
)
{
$position
=
0
;
foreach
(
explode
(
'/'
,
$subtask
->
path
)
as
$bit
)
{
// Remove things like double slashes completely.
if
(
!
isset
(
$bit
)
||
$bit
===
''
)
{
continue
;
}
if
(
$bit
[
0
]
==
'%'
&&
$bit
!=
'%'
)
{
if
(
$bit
[
0
]
==
'%'
&&
$bit
!=
'%'
)
{
// If an argument, swap it out with our argument loader and make sure
// If an argument, swap it out with our argument loader and make sure
// the argument gets passed through to the page callback.
// the argument gets passed through to the page callback.
...
@@ -153,6 +159,10 @@ function delegator_page_menu(&$items, $task) {
...
@@ -153,6 +159,10 @@ function delegator_page_menu(&$items, $task) {
else
if
(
$bit
[
0
]
!=
'!'
)
{
else
if
(
$bit
[
0
]
!=
'!'
)
{
$path
[]
=
$bit
;
$path
[]
=
$bit
;
}
}
// Increment position. We do it like this to skip empty items that
// could happen from erroneous paths like: this///that
$position
++
;
}
}
$menu_path
=
implode
(
'/'
,
$path
);
$menu_path
=
implode
(
'/'
,
$path
);
...
@@ -549,6 +559,10 @@ function delegator_page_form_basic_validate(&$form, &$form_state) {
...
@@ -549,6 +559,10 @@ function delegator_page_form_basic_validate(&$form, &$form_state) {
$found
=
FALSE
;
$found
=
FALSE
;
$error
=
FALSE
;
$error
=
FALSE
;
foreach
(
explode
(
'/'
,
$form_state
[
'values'
][
'path'
])
as
$bit
)
{
foreach
(
explode
(
'/'
,
$form_state
[
'values'
][
'path'
])
as
$bit
)
{
if
(
!
isset
(
$bit
)
||
$bit
===
''
)
{
continue
;
}
if
(
$bit
[
0
]
==
'%'
)
{
if
(
$bit
[
0
]
==
'%'
)
{
if
(
$found
)
{
if
(
$found
)
{
form_error
(
$form
[
'path'
],
t
(
'You cannot have a dynamic path element after an optional path element.'
));
form_error
(
$form
[
'path'
],
t
(
'You cannot have a dynamic path element after an optional path element.'
));
...
...
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