Skip to content

Commit

Permalink
Swap conditions, prevent ".." file lookup (#938)
Browse files Browse the repository at this point in the history
  • Loading branch information
mvorisek authored Feb 11, 2020
1 parent 907ba86 commit 5407184
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/DemoCallExitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class DemoCallExitTest extends BuiltInWebServerAbstract
private $regexJSON = '
/
(?(DEFINE)
(?<number> -? (?= [1-9]|0(?!\d) ) \d+ (\.\d+)? ([eE] [+-]? \d+)? )
(?<number> -? (?= [1-9]|0(?!\d) ) \d+ (\.\d+)? ([eE] [+-]? \d+)? )
(?<boolean> true | false | null )
(?<string> " ([^"\\\\]* | \\\\ ["\\\\bfnrt\/] | \\\\ u [0-9a-f]{4} )* " )
(?<array> \[ (?: (?&json) (?: , (?&json) )* )? \s* \] )
Expand All @@ -23,15 +23,15 @@ class DemoCallExitTest extends BuiltInWebServerAbstract
(?<json> \s* (?: (?&number) | (?&boolean) | (?&string) | (?&array) | (?&object) ) \s* )
)
\A (?&json) \Z
/six
/six
';
private $regexSSE = '/^[data|id|event].*$/m';

public function testableDemoFilesdataProvider()
{
$files = [];
foreach (scandir(dirname(__DIR__).DIRECTORY_SEPARATOR.'demos') as $file) {
if (is_dir($file) || substr($file, -3) !== 'php') {
if (substr($file, -3) !== 'php' || is_dir($file)) {
continue;
}

Expand Down

0 comments on commit 5407184

Please sign in to comment.