We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9baeecc commit 49ae6f9Copy full SHA for 49ae6f9
src/JsonFile.php
@@ -17,13 +17,6 @@ class JsonFile
17
*/
18
public function read($file)
19
{
20
- // Sanitize the file path
21
- $file = realpath($file);
22
-
23
- if ($file === false || strpos($file, __DIR__) !== 0) {
24
- throw new \Exception('Invalid file path');
25
- }
26
27
$contents = file_exists($file) ? file_get_contents($file) : '[]';
28
return json_decode($contents, true);
29
}
@@ -37,14 +30,7 @@ public function read($file)
37
30
38
31
public function write($file, $data)
39
32
40
41
42
43
44
45
46
47
33
file_put_contents($file, json_encode($data));
48
34
49
35
50
-?>
36
+?>
0 commit comments