Skip to content

Commit b705a06

Browse files
author
Oleksandr Gorkun
committed
MAGETWO-92162: [Backport for 2.2.x] Log File Validation
1 parent 64e6fe0 commit b705a06

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

dev/tests/functional/utils/log.php

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,13 @@
55
*/
66

77
if (!isset($_GET['name'])) {
8-
throw new \InvalidArgumentException('The name of log file is required for getting logs.');
8+
throw new \InvalidArgumentException(
9+
'The name of log file is required for getting logs.'
10+
);
911
}
10-
1112
$name = urldecode($_GET['name']);
1213
if (preg_match('/\.\.(\\\|\/)/', $name)) {
1314
throw new \InvalidArgumentException('Invalid log file name');
1415
}
15-
$logDir = '../../../../var/log';
16-
$logFile = realpath($logDir .'/' .$name);
17-
$file = file_get_contents($logFile);
1816

19-
echo serialize($file);
17+
echo serialize(file_get_contents('../../../../var/log' .'/' .$name));

0 commit comments

Comments
 (0)