Skip to content

Commit 9030d64

Browse files
authored
Merge pull request #490 from mainwp/mainwp-child-6-prepared
Mainwp child 6 prepared
2 parents ef7196c + 39b3242 commit 9030d64

193 files changed

Lines changed: 15447 additions & 1639 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

class/class-mainwp-backup.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@
99

1010
namespace MainWP\Child;
1111

12+
// Exit if accessed directly.
13+
if ( ! defined( 'ABSPATH' ) ) {
14+
exit;
15+
}
16+
17+
1218
//phpcs:disable WordPress.WP.AlternativeFunctions, Generic.Metrics.CyclomaticComplexity -- Current complexity is the only way to achieve desired results, pull request solutions appreciated.
1319

1420
/**
@@ -546,9 +552,9 @@ public function backup_full( $fileName ) { //phpcs:ignore -- complex method.
546552

547553
$file = false;
548554
if ( isset( $_POST['f'] ) ) {
549-
$file = ! empty( $_POST['f'] ) ? sanitize_text_field( wp_unslash( $_POST['f'] ) ) : false;
555+
$file = ! empty( $_POST['f'] ) ? MainWP_Helper::sanitize_filename( wp_unslash( $_POST['f'] ) ) : false;
550556
} elseif ( isset( $_POST['file'] ) ) {
551-
$file = ! empty( $_POST['file'] ) ? sanitize_text_field( wp_unslash( $_POST['file'] ) ) : false;
557+
$file = ! empty( $_POST['file'] ) ? MainWP_Helper::sanitize_filename( wp_unslash( $_POST['file'] ) ) : false;
552558
}
553559

554560
$ext = isset( $_POST['ext'] ) ? sanitize_text_field( wp_unslash( $_POST['ext'] ) ) : 'zip';

class/class-mainwp-child-aam.php

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

2424
use AAM_Service_SecurityAudit;
2525

26+
// Exit if accessed directly.
27+
if ( ! defined( 'ABSPATH' ) ) {
28+
exit;
29+
}
30+
2631
// phpcs:disable PSR1.Classes.ClassDeclaration, WordPress.WP.AlternativeFunctions -- Required to achieve desired results. Pull requests appreciated.
2732

2833
/**

0 commit comments

Comments
 (0)