Move getTempFolder out of Core.php to own file
FIX Prevent DOS by checking for env and admin on ?flush=1 (#1692)
Merge pull request #2246 from hafriedlander/fix/flush_24

 FIX Prevent DOS by checking for env and admin on ?flush=1 (#1692) in 2.4