Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
J
jquery
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
夏彬
jquery
Commits
b62e5522
Commit
b62e5522
authored
Sep 10, 2012
by
Markus Staab
Committed by
Dave Methvin
Sep 10, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix #12554. Sanitize data from POST. Close gh-908.
parent
5fb258b8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
3 deletions
+15
-3
AUTHORS.txt
AUTHORS.txt
+2
-1
polluted.php
test/polluted.php
+13
-2
No files found.
AUTHORS.txt
View file @
b62e5522
...
...
@@ -131,4 +131,5 @@ Chris Faulkner <thefaulkner@gmail.com>
Elijah Manor <elijah.manor@gmail.com>
Daniel Chatfield <chatfielddaniel@googlemail.com>
Nikita Govorov <nikita.govorov@gmail.com>
Mike Pennisi <mike@mikepennisi.com>
\ No newline at end of file
Mike Pennisi <mike@mikepennisi.com>
Markus Staab <markus.staab@redaxo.de>
\ No newline at end of file
test/polluted.php
View file @
b62e5522
...
...
@@ -42,11 +42,22 @@
if
(
count
(
$_POST
)
)
{
$includes
=
array
();
foreach
(
$_POST
as
$name
=>
$ver
){
if
(
empty
(
$libraries
[
$name
]
))
{
echo
"unsupported library "
.
$name
;
exit
;
}
$url
=
$libraries
[
$name
][
"url"
];
if
(
$name
==
"YUI"
&&
$ver
[
0
]
==
"2"
)
{
$url
=
str_replace
(
"/yui"
,
"/yuiloader"
,
$url
,
$count
=
2
);
$url
=
str_replace
(
"/yui"
,
"/yuiloader"
,
$url
);
}
if
(
empty
(
$libraries
[
$name
][
"versions"
][
$ver
]
))
{
echo
"library "
.
$name
.
" not supported in version "
.
$ver
;
exit
;
}
$include
=
"<script src='
$baseURL
"
.
str_replace
(
"XYZ"
,
$ver
,
$url
,
$count
=
1
)
.
"'></script>
\n
"
;
$include
=
"<script src='
$baseURL
"
.
str_replace
(
"XYZ"
,
$ver
,
$url
)
.
"'></script>
\n
"
;
if
(
$lib
==
"prototype"
)
{
// prototype must be included first
array_unshift
(
$includes
,
$include
);
}
else
{
...
...
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