Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
drupal
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
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
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
drupal
Commits
bbdc5256
Commit
bbdc5256
authored
Oct 14, 2012
by
Angie Byron
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#1798884
by Luukyb, alexpott: Convert path_alias_whitelist() to state system .
parent
546fcdfe
No related branches found
No related tags found
2 merge requests
!7452
Issue #1797438. HTML5 validation is preventing form submit and not fully...
,
!789
Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
core/includes/path.inc
+3
-3
3 additions, 3 deletions
core/includes/path.inc
core/modules/system/system.install
+12
-0
12 additions, 0 deletions
core/modules/system/system.install
with
15 additions
and
3 deletions
core/includes/path.inc
+
3
−
3
View file @
bbdc5256
...
...
@@ -72,7 +72,7 @@ function drupal_lookup_path($action, $path = '', $langcode = NULL) {
// Retrieve the path alias whitelist.
if
(
!
isset
(
$cache
[
'whitelist'
]))
{
$cache
[
'whitelist'
]
=
variable_get
(
'
path_alias_whitelist'
,
NULL
);
$cache
[
'whitelist'
]
=
state
()
->
get
(
'system.
path_alias_whitelist'
,
NULL
);
if
(
!
isset
(
$cache
[
'whitelist'
]))
{
$cache
[
'whitelist'
]
=
drupal_path_alias_whitelist_rebuild
();
}
...
...
@@ -391,7 +391,7 @@ function drupal_path_alias_whitelist_rebuild($source = NULL) {
// When paths are inserted, only rebuild the whitelist if the system path
// has a top level component which is not already in the whitelist.
if
(
!
empty
(
$source
))
{
$whitelist
=
variable_get
(
'
path_alias_whitelist'
,
NULL
);
$whitelist
=
state
()
->
get
(
'system.
path_alias_whitelist'
,
NULL
);
if
(
isset
(
$whitelist
[
strtok
(
$source
,
'/'
)]))
{
return
$whitelist
;
}
...
...
@@ -404,7 +404,7 @@ function drupal_path_alias_whitelist_rebuild($source = NULL) {
foreach
(
$result
as
$row
)
{
$whitelist
[
$row
->
path
]
=
TRUE
;
}
variable_set
(
'
path_alias_whitelist'
,
$whitelist
);
state
()
->
set
(
'system.
path_alias_whitelist'
,
$whitelist
);
return
$whitelist
;
}
...
...
This diff is collapsed.
Click to expand it.
core/modules/system/system.install
+
12
−
0
View file @
bbdc5256
...
...
@@ -2163,6 +2163,18 @@ function system_update_8028() {
update_variable_del
(
'menu_masks'
);
}
/**
* Convert path_alias_whitelist variable to state API.
*
* @ingroup state_upgrade
*/
function
system_update_8029
()
{
if
(
$value
=
update_variable_get
(
'path_alias_whitelist'
,
FALSE
))
{
state
()
->
set
(
'system.path_alias_whitelist'
,
$value
);
}
update_variable_del
(
'path_alias_whitelist'
);
}
/**
* @} End of "defgroup updates-7.x-to-8.x".
* The next series of updates should start at 9000.
...
...
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