Changeset 2870841
- Timestamp:
- 02/25/2023 02:16:02 AM (17 months ago)
- Location:
- my-style-anytime/tags/1.0.4
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
my-style-anytime/tags/1.0.4/includes/mysat-functions.php
r2870794 r2870841 59 59 60 60 /*** 61 62 ***/61 This function helps to check the status of DISALLOW_FILE_EDIT is it true or false. 62 ***/ 63 63 64 64 add_action( 'init', 'mysat_disallow_file_edit' ); … … 72 72 $config = preg_replace("/define\('DISALLOW_FILE_EDIT',\s*(false|'false')\);/i", "define('DISALLOW_FILE_EDIT', true);", $config); 73 73 file_put_contents($config_file, $config); 74 75 76 77 74 78 } elseif ($disallow_file_edit && preg_match("/define\('DISALLOW_FILE_EDIT',\s*(true|'true')\);/i", $config)) { 75 79 $config = preg_replace("/define\('DISALLOW_FILE_EDIT',\s*(true|'true')\);/i", "define('DISALLOW_FILE_EDIT', false);", $config); 76 80 file_put_contents($config_file, $config); 81 82 83 84 77 85 } elseif (!preg_match("/define\('DISALLOW_FILE_EDIT',/i", $config)) { 78 86 if ($disallow_file_edit) { 79 87 file_put_contents($config_file, "\n\ndefine('DISALLOW_FILE_EDIT', true);", FILE_APPEND); 88 80 89 } else { 81 90 file_put_contents($config_file, "\n\ndefine('DISALLOW_FILE_EDIT', false);", FILE_APPEND); 91 82 92 } 93 94 83 95 } 84 96 } -
my-style-anytime/tags/1.0.4/my-style-anytime.php
r2870794 r2870841 208 208 function mysat_deactivate_plugin() { 209 209 $config_file = ABSPATH . 'wp-config.php'; 210 $config = file_get_contents( $config_file ); 210 $config = file_get_contents($config_file); 211 212 $perms = fileperms($config_file) & 0777; 213 214 // Check permission if it is 0640 if not change it to 0640 215 if ($perms !== 0640) { 216 chmod($config_file, 0640); 217 } 211 218 212 219 if (preg_match("/define\('DISALLOW_FILE_EDIT',\s*(false|'false')\);/i", $config)) {
Note: See TracChangeset
for help on using the changeset viewer.