Skip to content

Commit 9a0c52d

Browse files
committed
Disable the PHAR stream wrapper
1 parent 85c2d8e commit 9a0c52d

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

app/console

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@
77

88
set_time_limit(0);
99

10+
// Disable the PHAR stream wrapper as it is insecure
11+
if (in_array('phar', stream_get_wrappers())) {
12+
stream_wrapper_unregister('phar');
13+
}
14+
1015
// Ensure UTF-8 is used in string operations
1116
setlocale(LC_CTYPE, 'C.UTF-8');
1217

web/app.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@
33
use Symfony\Component\HttpFoundation\Request;
44
use Symfony\Component\Debug\Debug;
55

6+
// Disable the PHAR stream wrapper as it is insecure
7+
if (in_array('phar', stream_get_wrappers())) {
8+
stream_wrapper_unregister('phar');
9+
}
10+
611
// Ensure UTF-8 is used in string operations
712
setlocale(LC_CTYPE, 'C.UTF-8');
813

0 commit comments

Comments
 (0)