Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/jsxc.nextcloud.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'build/appinfo/application.php')
-rw-r--r--build/appinfo/application.php10
1 files changed, 9 insertions, 1 deletions
diff --git a/build/appinfo/application.php b/build/appinfo/application.php
index a735c9d..9ffb63e 100644
--- a/build/appinfo/application.php
+++ b/build/appinfo/application.php
@@ -240,7 +240,7 @@ class Application extends App {
* This is automatically made lowercase.
*/
$container->registerService('OJSXC_UserId', function(IContainer $c) {
- return strtolower($c->query('UserId'));
+ return self::santizeUserId($c->query('UserId'));
});
/**
@@ -294,6 +294,14 @@ class Application extends App {
$c->query('OCP\IConfig'),
$c->getServer()->getDatabaseConnection()
);
+ }
+
+ static public function santizeUserId($userId) {
+ return str_replace([" ", "'", "@"], ["_ojsxc_esc_space_", "_ojsxc_squote_space_", "_ojsxc_esc_at_"],
+ strtolower(
+ $userId
+ )
+ );
}
}