We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents a54212a + 2754c03 commit 483b96cCopy full SHA for 483b96c
dev/tests/functional/utils/log.php
@@ -4,11 +4,16 @@
4
* See COPYING.txt for license details.
5
*/
6
7
+declare(strict_types=1);
8
+
9
if (!isset($_GET['name'])) {
- throw new \InvalidArgumentException('The name of log file is required for getting logs.');
10
+ throw new \InvalidArgumentException(
11
+ 'The name of log file is required for getting logs.'
12
+ );
13
}
-
14
$name = urldecode($_GET['name']);
-$file = file_get_contents('../../../../var/log/' . $name);
15
+if (preg_match('/\.\.(\\\|\/)/', $name)) {
16
+ throw new \InvalidArgumentException('Invalid log file name');
17
+}
18
-echo serialize($file);
19
+echo serialize(file_get_contents('../../../../var/log' .'/' .$name));
0 commit comments