Skip to content

Commit 412b65c

Browse files
committed
Allow more instructions
1 parent 233ab89 commit 412b65c

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

scripts/remote_server/index.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -466,6 +466,12 @@ function checkScriptFile($scriptfile, $fh, $params)
466466
if (preg_match('/^#?cd \/home\/jail\/home\/osu[a-z0-9]+\/dbn[a-z0-9]+\/htdocs\/install; php upgrade2\.php 0\.0\.0 0\.0\.0 [a-z_,]+$/i', $newline)) {
467467
continue;
468468
}
469+
if (preg_match('/^#?php \/home\/jail\/home\/osu[a-z0-9]+\/dbn[a-z0-9]+\/htdocs\/install\/upgrade2\.php 0\.0\.0 0\.0\.0 [a-z_,]+$/i', $newline)) {
470+
continue;
471+
}
472+
if (preg_match('/^#?cd \/home\/jail\/home\/osu[a-z0-9]+\/dbn[a-z0-9]+\/htdocs\/install$/i', $newline)) {
473+
continue;
474+
}
469475
// TODO enhance list of allowed patterns
470476
// ...
471477

@@ -474,11 +480,11 @@ function checkScriptFile($scriptfile, $fh, $params)
474480
}
475481

476482
if ($linenotvalid > 0) {
477-
fwrite($fh, date('Y-m-d H:i:s')." script file contains instructions line ".$linenotvalid." that does not match an allowed pattern.\n");
483+
fwrite($fh, date('Y-m-d H:i:s')." script file contains instructions line #".$linenotvalid." that does not match an allowed pattern.\n");
478484

479485
// CLI file is not valid
480486
http_response_code(599);
481-
print 'The CLI file '.$scriptfile.' contains instructions line '.$linenotvalid.' that does not match an allowed pattern.'."\n";
487+
print 'The CLI file '.$scriptfile.' contains instructions line #'.$linenotvalid.' that does not match an allowed pattern.'."\n";
482488
exit();
483489
} else {
484490
fwrite($fh, date('Y-m-d H:i:s')." script file is valid.\n");

0 commit comments

Comments
 (0)