Skip to content

Commit f377106

Browse files
authored
Prevent PHP fatals when directly accessing files, round 9 (#45537)
1 parent 2f4374e commit f377106

File tree

35 files changed

+150
-0
lines changed

35 files changed

+150
-0
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Significance: patch
2+
Type: fixed
3+
Comment: Prevent PHP errors by limiting direct access to files.
4+
5+

projects/packages/boost-core/src/lib/class-wpcom-boost-api-client.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@
99

1010
use Automattic\Jetpack\Boost_Core\Contracts\Boost_API_Client;
1111

12+
if ( ! defined( 'ABSPATH' ) ) {
13+
exit( 0 );
14+
}
15+
1216
/**
1317
* A class that handles the Boost API client.
1418
*
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Significance: patch
2+
Type: fixed
3+
Comment: Prevent PHP errors by limiting direct access to files.
4+
5+

projects/packages/boost-speed-score/src/class-speed-score-request.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@
1111
use Automattic\Jetpack\Boost_Core\Lib\Cacheable;
1212
use Automattic\Jetpack\Boost_Core\Lib\Url;
1313

14+
if ( ! defined( 'ABSPATH' ) ) {
15+
exit( 0 );
16+
}
17+
1418
/**
1519
* Class Speed_Score_Request
1620
*/
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Significance: patch
2+
Type: fixed
3+
Comment: Prevent PHP errors by limiting direct access to files.
4+
5+

projects/packages/classic-theme-helper/src/class-main.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@
99

1010
use WP_Error;
1111

12+
if ( ! defined( 'ABSPATH' ) ) {
13+
exit( 0 );
14+
}
15+
1216
/**
1317
* Classic Theme Helper Loader.
1418
*/

projects/packages/classic-theme-helper/src/content-options.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66
* @package automattic/jetpack-classic-theme-helper
77
*/
88

9+
if ( ! defined( 'ABSPATH' ) ) {
10+
exit( 0 );
11+
}
12+
913
/**
1014
* Content Options.
1115
*

projects/packages/classic-theme-helper/src/custom-content-types.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@
1818
use Automattic\Jetpack\Redirect;
1919
use Automattic\Jetpack\Status\Host;
2020

21+
if ( ! defined( 'ABSPATH' ) ) {
22+
exit( 0 );
23+
}
24+
2125
if ( ! function_exists( 'jetpack_load_custom_post_types' ) ) {
2226
/**
2327
* Load Portfolio, Testimonial, and Nova CPT.

projects/packages/classic-theme-helper/src/custom-post-types/class-jetpack-testimonial-textarea-control.php

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

88
namespace Automattic\Jetpack\Classic_Theme_Helper;
99

10+
if ( ! defined( 'ABSPATH' ) ) {
11+
exit( 0 );
12+
}
13+
1014
if ( ! class_exists( __NAMESPACE__ . '\Jetpack_Testimonial_Textarea_Control' ) ) {
1115
/**
1216
* Extends the WP_Customize_Control class to clean the textarea content.

projects/packages/classic-theme-helper/src/custom-post-types/class-jetpack-testimonial-title-control.php

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

88
namespace Automattic\Jetpack\Classic_Theme_Helper;
99

10+
if ( ! defined( 'ABSPATH' ) ) {
11+
exit( 0 );
12+
}
13+
1014
if ( ! class_exists( __NAMESPACE__ . '\Jetpack_Testimonial_Title_Control' ) ) {
1115
/**
1216
* Extends the WP_Customize_Control class to clean the title parameter.

0 commit comments

Comments
 (0)