mirror of
https://github.com/mainwp/mainwp-child.git
synced 2025-09-06 09:20:28 +08:00
[CodeFactor] Apply fixes
This commit is contained in:
parent
055f7232cd
commit
44cdebaf44
28 changed files with 891 additions and 829 deletions
|
@ -195,7 +195,7 @@ class MainWP_Child_Skeleton_Key {
|
|||
public function save_settings() {
|
||||
$settings = isset($_POST['settings']) ? $_POST['settings'] : array();
|
||||
|
||||
if (!is_array($settings) || empty($settings)) {
|
||||
if ( ! is_array($settings) || empty($settings)) {
|
||||
return array( 'error' => 'Invalid data. Please check and try again.' );
|
||||
}
|
||||
|
||||
|
@ -203,11 +203,11 @@ class MainWP_Child_Skeleton_Key {
|
|||
'general' => array( 'blogname', 'blogdescription', 'gmt_offset', 'date_format', 'time_format', 'start_of_week', 'timezone_string', 'WPLANG' ),
|
||||
);
|
||||
|
||||
if ( !is_multisite() ) {
|
||||
if ( !defined( 'WP_SITEURL' ) ) {
|
||||
if ( ! is_multisite() ) {
|
||||
if ( ! defined( 'WP_SITEURL' ) ) {
|
||||
$whitelist_options['general'][] = 'siteurl';
|
||||
}
|
||||
if ( !defined( 'WP_HOME' ) ) {
|
||||
if ( ! defined( 'WP_HOME' ) ) {
|
||||
$whitelist_options['general'][] = 'home';
|
||||
}
|
||||
|
||||
|
@ -231,7 +231,7 @@ class MainWP_Child_Skeleton_Key {
|
|||
}
|
||||
|
||||
$updated = false;
|
||||
foreach($settings as $option => $value) {
|
||||
foreach ($settings as $option => $value) {
|
||||
if (in_array($option, $whitelist_general)) {
|
||||
if ( ! is_array( $value ) ) {
|
||||
$value = trim( $value );
|
||||
|
@ -242,7 +242,7 @@ class MainWP_Child_Skeleton_Key {
|
|||
}
|
||||
}
|
||||
|
||||
if (!$updated) {
|
||||
if ( ! $updated) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue