aboutsummaryrefslogtreecommitdiff
path: root/app/Models
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2017-02-25 12:39:08 +0100
committerGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2017-02-25 12:39:08 +0100
commit271a1fdc8900a8b2c32675c22dce1cc458209de4 (patch)
tree10f4e575e3d907b637f60128d270ac9a7576ce46 /app/Models
parent2e871a0adf131f53dcf345ad2dda73bdf7c1a2c9 (diff)
Missing checkUsername and const patten
https://github.com/FreshRSS/FreshRSS/pull/1423 https://github.com/YunoHost-Apps/freshrss_ynh/issues/27#issuecomment-279792363
Diffstat (limited to 'app/Models')
-rw-r--r--app/Models/Feed.php2
-rw-r--r--app/Models/UserDAO.php2
2 files changed, 2 insertions, 2 deletions
diff --git a/app/Models/Feed.php b/app/Models/Feed.php
index 97cb1c47e..7a9cf8612 100644
--- a/app/Models/Feed.php
+++ b/app/Models/Feed.php
@@ -442,7 +442,7 @@ class FreshRSS_Feed extends Minz_Model {
file_put_contents(USERS_PATH . '/_/log_pshb.txt', date('c') . "\t" . $text . "\n", FILE_APPEND);
}
$currentUser = Minz_Session::param('currentUser');
- if (ctype_alnum($currentUser) && !file_exists($path . '/' . $currentUser . '.txt')) {
+ if (FreshRSS_user_Controller::checkUsername($currentUser) && !file_exists($path . '/' . $currentUser . '.txt')) {
touch($path . '/' . $currentUser . '.txt');
}
}
diff --git a/app/Models/UserDAO.php b/app/Models/UserDAO.php
index 32bc6de2f..a60caf395 100644
--- a/app/Models/UserDAO.php
+++ b/app/Models/UserDAO.php
@@ -85,7 +85,7 @@ class FreshRSS_UserDAO extends Minz_ModelPdo {
}
public static function touch($username = '') {
- if (($username == '') || (!ctype_alnum($username))) {
+ if (!FreshRSS_user_Controller::checkUsername($username)) {
$username = Minz_Session::param('currentUser', '_');
}
return touch(join_path(DATA_PATH , 'users', $username, 'config.php'));