Skip to content

Commit 29def5e

Browse files
committed
Added abspath check for auto generated files
1 parent 5d29e08 commit 29def5e

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

‎src/Discovery/ListenerDiscovery.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ public function cache(?string $path = null)
220220
File::put(
221221
$path,
222222
"<?php \r\n\r\n/** Auto generated by discovering the listeners. Don't edit this file manually."
223-
. " */\r\n\r\nreturn "
223+
. " */\r\n\r\ndefined('ABSPATH') || exit;\r\n\r\nreturn "
224224
// phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_var_export -- Generates a cached PHP file's return statement; this is var_export's documented use case, not debug output.
225225
. var_export($this->listeners(), true) . ';'
226226
);

‎src/Discovery/PolicyDiscovery.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ public function cache(?string $path = null)
197197
File::put(
198198
$path,
199199
"<?php \r\n\r\n/** Auto generated by discovering the policies. Don't edit this file manually."
200-
. " */\r\n\r\nreturn "
200+
. " */\r\n\r\ndefined('ABSPATH') || exit;\r\n\r\nreturn "
201201
// phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_var_export -- Generates a cached PHP file's return statement; this is var_export's documented use case, not debug output.
202202
. var_export($this->policies(), true) . ';'
203203
);

0 commit comments

Comments
 (0)