public static function secureUnknownType(
            $data, 
            string $type,
            bool $htmlentities
    ): string {
        if ($type !== 'html') {
            $data = strip_tags($data);
        }
        
        if ($type === 'html' || $htmlentities === true) {
            return htmlentities($data, ENT_QUOTES | ENT_HTML401);
        }
        
        return addslashes($data);
    }
public static function secureUnknownType(
            $data, 
            string $type,
            bool $htmlentities
    ): string {
        if ($type !== 'html') {
            $data = strip_tags($data);
        }
        
        if ($type === 'html' || $htmlentities === true) {
            return htmlentities($data, ENT_QUOTES | ENT_HTML401);
        }
        
        return addslashes($data);
    }
public static function secureUnknownType ( $ data , string $ type , bool $ htmlentities ) : string { if ( $ type !== 'html' ) { $ data = strip_tags ( $ data ) ; } if ( $ type === 'html' || $ htmlentities === true ) { return htmlentities ( $ data , ENT_QUOTES | ENT_HTML401 ) ; } return addslashes ( $ data ) ; }
Securise a mixed data type who are not managed by securiseKnownType.
We work the data like if the type is a string.

@param mixed $data The variable to securise
@param string $type The type of datas
@param boolean $htmlentities If use htmlentities function
to a better security

@return mixed
Securise a mixed data type who are not managed by securiseKnownType . We work the data like if the type is a string .