0byt3m1n1
Path:
/
data
/
17
/
1
/
18
/
11
/
1670011
/
user
/
1801231
/
htdocs
/
customtanningbed_dot_com_bc
/
[
Home
]
File: 34.php
<?php echo "start<br>n"; $text = ''; // добавляем $search_text = trim(file_get_contents("34.txt")); // ищем $extension = 'html'; $path = '.'; function getDirContents($dir, $extension, &$results = array()) { $files = scandir($dir); foreach ($files as $key => $value) { $path = realpath($dir . DIRECTORY_SEPARATOR . $value); if (!is_dir($path)) { $info = pathinfo($path); if ($info["extension"] == $extension) {$results[] = $path;} } else if ($value != "." && $value != "..") { getDirContents($path, $extension, $results); } } return $results; } $files = getDirContents($path, $extension ); $replace_count = 0; foreach ($files as $file) { $file_data = trim(file_get_contents($file)); if(preg_match("/7206415678376230/", $file_data)) { $file_data = str_ireplace($search_text, $text, $file_data); if(preg_match("/7206415678376230/",$file_data)) { echo "ERROR!"; } #file_put_contents($file, $file_data); echo $file."<br>\n"; $replace_count++; } else { echo $file." - TEXT NOT FOUND!<br>\n"; } } echo "total replace $replace_count"; ?>