Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if ($this->definedTRUE('force_wpconfig_loader_inject') && function_exists('sanitize_text_field') && empty($GLOBALS['goto_my_wpConfig']) && !defined("include_my_custom_wpConfig")){
- $filter = function ($path){return str_replace(array('/','\\'),DIRECTORY_SEPARATOR, $path); };
- //add in wp-config
- $str='define("include_my_custom_wpConfig",true); if(file_exists($a=__DIR__."/'.str_replace( $filter(ABSPATH),'', $filter($loader_file)).'")){ include_once($a); }';
- $wp_config=ABSPATH.'wp-config.php';
- //$new_content= preg_replace('/define\(\'DB_COLLATE(.*?)\);/', '$0'."\r\n\r\n".$str, $this->file_get_contents($wp_config), 1);
- $new_content= str_replace('/* That\'s all, stop editing', $str."\r\n\r\n".'/* That\'s all, stop editing', $this->file_get_contents($wp_config));
- $this->file_put_contents($wp_config,$new_content);
- //create file
- $loader_file=$filter(dirname(dirname(__DIR__)).'/custom_files/__loader_wp_config.php');
- if(!file_exists($loader_file)) {
- $this->file_put_contents($loader_file, '<?php
- // check if this file is included IN WP-CONFIG
- if (defined("include_my_custom_wpConfig")) {
- if (!defined("my_wp_cofnig_called")) { define("my_wp_cofnig_called", 1);
- define("WP_DEBUG", 0);
- define("WP_DEBUG_DISPLAY", 0);
- return;
- }
- }
- ?>'
- );
- }
- $GLOBALS['goto_my_wpConfig']=1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement