Skip to content

Commit

Permalink
Ensure template string does not contain slashes
Browse files Browse the repository at this point in the history
  • Loading branch information
cs278 committed Jan 24, 2016
1 parent 34f789b commit d6bf280
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/functions.php
Expand Up @@ -82,6 +82,10 @@ function pathTemplate($template)
$useRandomInt = function_exists('random_int');
}

if (false !== strpos($template, '\\') || false !== strpos($template, '/')) {
throw new \InvalidArgumentException('Template must not contain back or forward slashes');
}

$len = 0;

if (false !== $pos = strrpos($template, 'X')) {
Expand Down

0 comments on commit d6bf280

Please sign in to comment.