Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
simplesamlphp
Manage
Activity
Members
Labels
Plan
Jira
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Perun
Perun ProxyIdP
v1
simplesamlphp
Commits
a80a7a0a
Commit
a80a7a0a
authored
6 years ago
by
Jaime Pérez Crespo
Browse files
Options
Downloads
Patches
Plain Diff
Stop using the deprecated TemplateLoader::parseName() method.
It was deprecated in Twig 1.x and removed in 2.0.
parent
22c51125
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
lib/SimpleSAML/XHTML/TemplateLoader.php
+12
-4
12 additions, 4 deletions
lib/SimpleSAML/XHTML/TemplateLoader.php
with
12 additions
and
4 deletions
lib/SimpleSAML/XHTML/TemplateLoader.php
+
12
−
4
View file @
a80a7a0a
...
@@ -16,9 +16,9 @@ class TemplateLoader extends \Twig\Loader\FilesystemLoader
...
@@ -16,9 +16,9 @@ class TemplateLoader extends \Twig\Loader\FilesystemLoader
*
*
* @inheritdoc
* @inheritdoc
*/
*/
protected
function
findTemplate
(
$name
)
protected
function
findTemplate
(
$name
,
$throw
=
true
)
{
{
list
(
$namespace
,
$shortname
)
=
$this
->
parseName
(
$name
);
list
(
$namespace
,
$shortname
)
=
$this
->
parse
Module
Name
(
$name
);
if
(
!
in_array
(
$namespace
,
$this
->
paths
,
true
)
&&
$namespace
!==
self
::
MAIN_NAMESPACE
)
{
if
(
!
in_array
(
$namespace
,
$this
->
paths
,
true
)
&&
$namespace
!==
self
::
MAIN_NAMESPACE
)
{
$this
->
addPath
(
self
::
getModuleTemplateDir
(
$namespace
),
$namespace
);
$this
->
addPath
(
self
::
getModuleTemplateDir
(
$namespace
),
$namespace
);
}
}
...
@@ -26,7 +26,15 @@ class TemplateLoader extends \Twig\Loader\FilesystemLoader
...
@@ -26,7 +26,15 @@ class TemplateLoader extends \Twig\Loader\FilesystemLoader
}
}
protected
function
parseName
(
$name
,
$default
=
self
::
MAIN_NAMESPACE
)
/**
* Parse the name of a template in a module.
*
* @param string $name The full name of the template, including namespace and template name / path.
*
* @return array An array with the corresponding namespace and name of the template. The namespace defaults to
* \Twig\Loader\FilesystemLoader::MAIN_NAMESPACE, if none was specified in $name.
*/
protected
function
parseModuleName
(
$name
,
$default
=
self
::
MAIN_NAMESPACE
)
{
{
if
(
strpos
(
$name
,
':'
))
{
if
(
strpos
(
$name
,
':'
))
{
// we have our old SSP format
// we have our old SSP format
...
@@ -37,7 +45,7 @@ class TemplateLoader extends \Twig\Loader\FilesystemLoader
...
@@ -37,7 +45,7 @@ class TemplateLoader extends \Twig\Loader\FilesystemLoader
));
));
return
array
(
$namespace
,
$shortname
);
return
array
(
$namespace
,
$shortname
);
}
}
return
parent
::
parseName
(
$name
,
$default
)
;
return
[
$default
,
$name
]
;
}
}
...
...
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