mirror of
https://github.com/pierre42100/ComunicAPI
synced 2025-06-18 16:18:04 +00:00
Can find user ID with its folder name
This commit is contained in:
@ -102,4 +102,21 @@ function check_string_before_insert($string){
|
||||
|
||||
//Success
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Make a string safe to be used to perform a query on a database
|
||||
*
|
||||
* @param string $input The string to process
|
||||
* @return string The result string
|
||||
*/
|
||||
function safe_for_sql(string $input) : string {
|
||||
|
||||
//Perform safe adapation
|
||||
$input = str_ireplace("\\", "\\\\", $input);
|
||||
$input = str_ireplace("'", "\\'", $input);
|
||||
$input = str_ireplace('"', "\\\"", $input);
|
||||
|
||||
return $input;
|
||||
|
||||
}
|
Reference in New Issue
Block a user