Skip to content

Commit 8481f5c

Browse files
authored
Merge pull request #582 from BoldGrid/branch-1.15.9
Branch 1.15.9
2 parents a47c8c3 + 1fdab1b commit 8481f5c

File tree

3 files changed

+16
-2
lines changed

3 files changed

+16
-2
lines changed

boldgrid-backup.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
* Plugin Name: Total Upkeep
1717
* Plugin URI: https://www.boldgrid.com/boldgrid-backup/
1818
* Description: Automated backups, remote backup to Amazon S3 and Google Drive, stop website crashes before they happen and more. Total Upkeep is the backup solution you need.
19-
* Version: 1.15.8
19+
* Version: 1.15.9
2020
* Author: BoldGrid
2121
* Author URI: https://www.boldgrid.com/
2222
* License: GPL-2.0+

cli/bgbkup-cli.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,17 @@
3232
exit( 1 );
3333
}
3434

35+
/*
36+
* We need to ensure that this is only run from the command-line.
37+
* Some environments use different SAPI names for CLI, such as 'cli'
38+
* or 'cli-server'. Therefore we check for the first three characters.
39+
*/
40+
$sapi_type = php_sapi_name();
41+
42+
if ( is_string( $sapi_type ) && 'cli' !== substr( $sapi_type, 0, 3 ) ) {
43+
throw new \Exception( 'This script must be run from the command line.' );
44+
}
45+
3546
require __DIR__ . '/class-info.php';
3647
require __DIR__ . '/class-site-check.php';
3748
require __DIR__ . '/class-log.php';

readme.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Tags: backup, cloud backup, database backup, restore, wordpress backup
44
Requires at least: 4.4
55
Tested up to: 6.4
66
Requires PHP: 5.4
7-
Stable tag: 1.15.8
7+
Stable tag: 1.15.9
88
License: GPLv2 or later
99
License URI: http://www.gnu.org/licenses/gpl-2.0.html
1010

@@ -132,6 +132,9 @@ Have a problem? First, take a look at our [Getting Started](https://www.boldgrid
132132

133133
== Changelog ==
134134

135+
= 1.15.9 =
136+
* Bug Fix: Fixed security issue with bgbkup-cli being executable from the web, when it should only be executable via cli.
137+
135138
= 1.15.8 =
136139

137140
Release date: January 9, 2024

0 commit comments

Comments
 (0)