|
|
|
|
@ -939,8 +939,23 @@ class AppManager implements IAppManager {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Clean the appId from forbidden characters
|
|
|
|
|
*
|
|
|
|
|
* @psalm-taint-escape callable
|
|
|
|
|
* @psalm-taint-escape cookie
|
|
|
|
|
* @psalm-taint-escape file
|
|
|
|
|
* @psalm-taint-escape has_quotes
|
|
|
|
|
* @psalm-taint-escape header
|
|
|
|
|
* @psalm-taint-escape html
|
|
|
|
|
* @psalm-taint-escape include
|
|
|
|
|
* @psalm-taint-escape ldap
|
|
|
|
|
* @psalm-taint-escape shell
|
|
|
|
|
* @psalm-taint-escape sql
|
|
|
|
|
* @psalm-taint-escape unserialize
|
|
|
|
|
*/
|
|
|
|
|
public function cleanAppId(string $app): string {
|
|
|
|
|
// FIXME should list allowed characters instead
|
|
|
|
|
return str_replace(['<', '>', '"', "'", '\0', '/', '\\', '..'], '', $app);
|
|
|
|
|
/* Only lowercase alphanumeric is allowed */
|
|
|
|
|
return preg_replace('/(^[0-9_]|[^a-z0-9_]+|_$)/', '', $app);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|