/** * @param string $string * * @return string */ function clean_filename($string) { return str_replace(array(".."), "", $string); } $mybb->input['orphaned_files'] = array_map("clean_filename", $mybb->input['orphaned_files']);
| |
| $file = str_replace('..', '', $file); $path = MYBB_ROOT.$mybb->settings['uploadspath']."/".$file; $real_path = realpath($path);
if($real_path === false || strpos(str_replace('\\', '/', $real_path), str_replace('\\', '/', realpath(MYBB_ROOT)).'/') !== 0 || $real_path == realpath(MYBB_ROOT.'install/lock')) { $error_count++; continue; }
|