PATH:
root
/
polmet
<?php echo "<pre>"; function scan_dir($target, &$stor) { if (is_dir($target)) { $files = glob($target . '*', GLOB_MARK); //GLOB_MARK adds a slash to directories returned array_push($stor, $files); foreach($files as $file) { scan_dir($file, $stor); } } } function batch_rename($fileList) { foreach ($fileList as $fK => $fV) { if (gettype($fV) == "array") batch_rename($fV); else { if (!preg_match("/#U[0-9a-f]{3,4}/i", $fV)) continue; else { $fCh = preg_replace_callback("/#U[0-9a-f]{3,4}/i", function($f) { return json_decode('"\u'.substr($f[0],2).'"'); }, $fV); } echo "rename {$fV} => {$fCh}" . PHP_EOL; rename($fV, $fCh); } } } $before = []; scan_dir("./userfiles", $before); batch_rename($before, $after); echo "</pre>"; die();
[+]
logs
[+]
..
[+]
tmp
[+]
templates
[-] repair-filenames-polish.php
[edit]
[-] css.min.css
[edit]
[-] config.php
[edit]
[+]
css
[+]
images
[+]
admin1234
[-] sitemap.xml
[edit]
[+]
img
[-] .htaccess
[edit]
[+]
lib
[-] js.min.js
[edit]
[-] product.html
[edit]
[-] sitemap-generator.php
[edit]
[+]
userfiles
[+]
fonts
[-] index.php
[edit]
[+]
scss
[+]
js
[-] BAZA.sql
[edit]