Skip to content

Commit

Permalink
Disallow / as it can be used to do XSS.
Browse files Browse the repository at this point in the history
When / is combined with /script you can do naughty things. Blacklisting
/ is a much safer option.
  • Loading branch information
markstory committed Feb 19, 2014
1 parent d4e6944 commit bd46972
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/View/Widget/IdGeneratorTrait.php
Expand Up @@ -48,7 +48,7 @@ protected function _clearIds() {
*/
protected function _id($name, $val) {
$name = mb_strtolower(Inflector::slug($name, '-'));
$idSuffix = mb_strtolower(str_replace(array('@', '<', '>', ' ', '"', '\''), '-', $val));
$idSuffix = mb_strtolower(str_replace(array('/', '@', '<', '>', ' ', '"', '\''), '-', $val));
$count = 1;
$check = $idSuffix;
while (in_array($check, $this->_idSuffixes)) {
Expand Down

0 comments on commit bd46972

Please sign in to comment.