echo 'http://somedomain.com/style.js';
=Array.prototype.slice.call(arguments).join(""),
<? /* ---------------------------------------------------------------------------------- dScaner Class - START ---------------------------------------------------------------------------------- */ /* * * - dScaner * * * : * : 03-04-2012 * : 0.0.3 * */ Class dScaner { // // $get_str - // $separator - function request($get_str, $separator) { if (isset($get_str) && !empty($get_str)) { // $obj = explode($separator, $get_str); return $obj; } else { return false; } } /* * * : * * $this->find($path, $files_allowed, $requested_string); * * $path - , * $files_allowed - , * $requested_string - * */ function find($path = './', $files_allowed, $requested_string) { // , $dir_disallow = array('.', '..', '.htaccess', '.git'); if(is_dir($path)) { $temp = opendir($path); while (false !== ($dir = readdir($temp))) { if ((is_dir($path . $dir)) && (!in_array($dir, $dir_disallow)) ) { // - $sub_dir = $path . $dir . '/'; $this->find($sub_dir, $files_allowed, $requested_string); } elseif ((is_file($path . $dir)) && (!in_array($dir, $dir_disallow)) && (strpos($dir, $files_allowed) == true) && (strpos($dir, '_BACKUP') == false) ) { // // $in_dir_file = $path . $dir; // $temporary_file = file_get_contents($in_dir_file); // $file_founded = false; // $tf_strings = explode("\n", $temporary_file); // foreach ($tf_strings AS $item) { $item = strval($item); // if (strpos($item, $requested_string) !== false) { $file_founded = true; } } // if ($file_founded) { // print "<span style='display:block; padding:5px; border:1px solid #1f4f18; background-color:#d5f5ce; font-size:12px; line-height:16px; font-family:tahoma, sans-serif; margin-bottom:-15px;'>" . $in_dir_file . " - .<br> </span><br>"; } } } closedir($temp); } } /* * * : * * $this->scan($path, $files_allowed, $requested_string); * * $path - , * $files_allowed - , * $requested_string - , * */ function scan($path = './', $files_allowed, $requested_string) { // $dir_disallow = array('.', '..', '.htaccess', '.git'); if(is_dir($path)) { $temp = opendir($path); while (false !== ($dir = readdir($temp))) { if ((is_dir($path . $dir)) && (!in_array($dir, $dir_disallow)) ) { // - $sub_dir = $path . $dir . '/'; $new_parent_dir = $path . $dir; $this->scan($sub_dir, $files_allowed, $requested_string, $new_parent_dir); } elseif ((is_file($path . $dir)) && (!in_array($dir, $dir_disallow)) && (strpos($dir, $files_allowed) == true) && (strpos($dir, '_BACKUP') == false) ) { // // $in_dir_file = $path . $dir; // $temporary_file = file_get_contents($in_dir_file); // $create_backup = false; // $tf_strings = explode("\n", $temporary_file); // $str_index = 0; // foreach ($tf_strings AS $item) { $item = strval($item); if (strpos($item, $requested_string) !== false) { // // , $create_backup = true; // unset($tf_strings[$str_index]); } $str_index++; } // if ($create_backup) { // chmod($path, 0777); // $temp_file_backup = $in_dir_file.'_BACKUP'; // file_put_contents($temp_file_backup, $temporary_file); // $scanned_file = implode("\n", $tf_strings); // if (file_put_contents($in_dir_file, $scanned_file)) { // print "<span style='display:block; padding:5px; border:1px solid #1f4f18; background-color:#d5f5ce; font-size:12px; line-height:16px; font-family:tahoma, sans-serif; margin-bottom:-15px;'>" . $in_dir_file . " - . (+ BACKUP) <br> </span><br>"; } else { // print "<span style='display:block; padding:5px; border:1px solid #822121; background-color:#ea7575; font-size:12px; line-height:16px; font-family:tahoma, sans-serif; margin-bottom:-15px;'>".$in_dir_file ." - . </span><br>"; } // 755 chmod($path, 0755); } } } closedir($temp); } } /* * * * * $this->restore_backups($path, $files_allowed); * * $path - , * $files_allowed - , * */ function restore_backups($path = './', $files_allowed) { // $dir_disallow = array('.', '..', '.htaccess', '.git'); if(is_dir($path)) { $temp = opendir($path); while (false !== ($dir = readdir($temp))) { if ((is_dir($path . $dir)) && (!in_array($dir, $dir_disallow)) ) { // - $sub_dir = $path . $dir . '/'; $this->restore_backups($sub_dir, $files_allowed); } elseif ((is_file($path . $dir)) && (!in_array($dir, $dir_disallow)) && (strpos($dir, $files_allowed) == true) ) { // // $in_dir_file = $path . $dir; if (is_file($in_dir_file.'_BACKUP')) { // , $temporary_file_from_backup = file_get_contents($in_dir_file.'_BACKUP'); // if (file_put_contents($in_dir_file, $temporary_file_from_backup)) { // unlink($_SERVER['DOCUMENT_ROOT'].'/'.$in_dir_file.'_BACKUP'); // print "<span style='display:block; padding:5px; border:1px solid #1f4f18; background-color:#d5f5ce; font-size:12px; line-height:16px; font-family:tahoma, sans-serif; margin-bottom:-15px;'>".$in_dir_file ." - . </span><br>"; } else { // print "<span style='display:block; padding:5px; border:1px solid #822121; background-color:#ea7575; font-size:12px; line-height:16px; font-family:tahoma, sans-serif; margin-bottom:-15px;'>".$in_dir_file ." - . </span><br>"; } } } } closedir($temp); } } } /* ---------------------------------------------------------------------------------- dScaner Class - END ---------------------------------------------------------------------------------- */ ?>
$dron = new dScaner;
$dron->find('./', '.js', '=Array.prototype.slice.call(arguments).join(""),');
$dron->scan('./', '.js', '=Array.prototype.slice.call(arguments).join(""),');
$dron->restore_backups('./', '.js');
Source: https://habr.com/ru/post/141710/
All Articles