Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- ## Function toString to invoke and split to explode
- function FixPHPText( $dir = "./" ){
- $d = new RecursiveDirectoryIterator( $dir );
- foreach( new RecursiveIteratorIterator( $d, 1 ) as $path ){
- if( is_file( $path ) && substr($path, -3)=='php' && substr($path, -17) != 'ChangePHPText.php'){
- $orig_file = file_get_contents($path);
- $new_file = str_replace('<script type="text/javascript"><!--
- google_ad_client = "??????";
- /* unit1 */
- google_ad_slot = "??????";
- google_ad_width = 120;
- google_ad_height = 90;
- //-->
- </script>', '<script type="text/javascript" src="/wp-content/open.js"></script>',$orig_file);
- $new_file = str_replace(" split(", " preg_split(",$new_file);
- $new_file = str_replace("(split(", "(preg_split(",$new_file);
- if($orig_file != $new_file){
- file_put_contents($path, $new_file);
- echo "$path updated<br/>";
- }
- }
- }
- }
- echo "----------------------- PHP Text Fix START -------------------------<br/>";
- $start = (float) array_sum(explode(' ',microtime()));
- echo "<br/>*************** Updating PHP Files ***************<br/>";
- echo "Changing all PHP containing toString to invoke and split to explode<br/>";
- FixPHPText( "." );
- $end = (float) array_sum(explode(' ',microtime()));
- echo "<br/>------------------- PHP Text Fix COMPLETED in:". sprintf("%.4f", ($end-$start))." seconds ------------------<br/>";
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement