Made checkUserDirectoryValidity generic

This commit is contained in:
Pierre HUBERT 2018-07-14 11:10:57 +02:00
parent cb422ef627
commit 82e8106b71

View File

@ -528,7 +528,7 @@ function save_post_image(string $fieldName, int $userID, string $folder, int $ma
* @param string $directory The directory to check * @param string $directory The directory to check
* @return bool TRUE if the domain seems to be valid / FALSE else * @return bool TRUE if the domain seems to be valid / FALSE else
*/ */
function checkUserDirectoryValidity(string $directory) : bool { function checkVirtualDirectoryValidity(string $directory) : bool {
//Check domain length //Check domain length
if(strlen($directory) < 4) if(strlen($directory) < 4)
@ -557,7 +557,7 @@ function getPostUserDirectory(string $name) : string {
$directory = (string) $_POST[$name]; $directory = (string) $_POST[$name];
//Check domain validity //Check domain validity
if(!checkUserDirectoryValidity($directory)) if(!checkVirtualDirectoryValidity($directory))
Rest_fatal_error(401, "Specified directory seems to be invalid!"); Rest_fatal_error(401, "Specified directory seems to be invalid!");
//Return the directory //Return the directory