Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
D
drupal
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Custom Issue Tracker
Custom Issue Tracker
Labels
Merge Requests
220
Merge Requests
220
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Analytics
Analytics
Code Review
Insights
Issue
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
project
drupal
Commits
bbdc5256
Commit
bbdc5256
authored
Oct 13, 2012
by
webchick
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue
#1798884
by Luukyb, alexpott: Convert path_alias_whitelist() to state system .
parent
546fcdfe
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
3 deletions
+15
-3
core/includes/path.inc
core/includes/path.inc
+3
-3
core/modules/system/system.install
core/modules/system/system.install
+12
-0
No files found.
core/includes/path.inc
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
;
}
...
...
core/modules/system/system.install
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.
...
...
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