*/
$app = $_POST["app"];
+$app = OC_App::cleanAppId($app);
$l = OC_L10N::get( $app );
static private $checkedApps = array();
static private $altLogin = array();
+ /**
+ * @brief clean the appid
+ * @param $app Appid that needs to be cleaned
+ * @return string
+ */
+ public static function cleanAppId($app) {
+ return str_replace(array('\0', '/', '\\', '..'), '', $app);
+ }
+
/**
* @brief loads all apps
* @param array $types
register_shutdown_function(array('OC_Helper', 'cleanTmp'));
//parse the given parameters
- self::$REQUESTEDAPP = (isset($_GET['app']) && trim($_GET['app']) != '' && !is_null($_GET['app']) ? str_replace(array('\0', '/', '\\', '..'), '', strip_tags($_GET['app'])) : OC_Config::getValue('defaultapp', 'files'));
+ self::$REQUESTEDAPP = (isset($_GET['app']) && trim($_GET['app']) != '' && !is_null($_GET['app']) ? OC_App::cleanAppId(strip_tags($_GET['app'])) : OC_Config::getValue('defaultapp', 'files'));
if (substr_count(self::$REQUESTEDAPP, '?') != 0) {
$app = substr(self::$REQUESTEDAPP, 0, strpos(self::$REQUESTEDAPP, '?'));
$param = substr($_GET['app'], strpos($_GET['app'], '?') + 1);
if ($this->app === true) {
return;
}
- $app = $this->app;
+ $app = OC_App::cleanAppId($this->app);
$lang = $this->lang;
$this->app = true;
// Find the right language
OC_JSON::checkAdminUser();
OCP\JSON::callCheck();
-OC_App::disable($_POST['appid']);
+OC_App::disable(OC_App::cleanAppId($_POST['appid']));
OC_JSON::success();
OC_JSON::checkAdminUser();
OCP\JSON::callCheck();
-$appid = OC_App::enable($_POST['appid']);
+$appid = OC_App::enable(OC_App::cleanAppId($_POST['appid']));
if($appid !== false) {
OC_JSON::success(array('data' => array('appid' => $appid)));
} else {
OCP\JSON::callCheck();
$app = $_GET['app'];
+$app = OC_App::cleanAppId($app);
//load the one app and see what it adds to the navigation
OC_App::loadApp($app);
OCP\JSON::callCheck();
$appid = $_POST['appid'];
+$appid = OC_App::cleanAppId($appid);
$result = OC_Installer::updateApp($appid);
if($result !== false) {