mirror of
https://git.tt-rss.org/git/tt-rss.git
synced 2025-12-13 22:35:55 +00:00
force cast profile id to integer when assigning to session variable
This commit is contained in:
@@ -509,7 +509,7 @@ class Handler_Public extends Handler {
|
|||||||
|
|
||||||
if (clean($_POST["profile"])) {
|
if (clean($_POST["profile"])) {
|
||||||
|
|
||||||
$profile = clean($_POST["profile"]);
|
$profile = (int) clean($_POST["profile"]);
|
||||||
|
|
||||||
$sth = $this->pdo->prepare("SELECT id FROM ttrss_settings_profiles
|
$sth = $this->pdo->prepare("SELECT id FROM ttrss_settings_profiles
|
||||||
WHERE id = ? AND owner_uid = ?");
|
WHERE id = ? AND owner_uid = ?");
|
||||||
@@ -517,6 +517,8 @@ class Handler_Public extends Handler {
|
|||||||
|
|
||||||
if ($sth->fetch()) {
|
if ($sth->fetch()) {
|
||||||
$_SESSION["profile"] = $profile;
|
$_SESSION["profile"] = $profile;
|
||||||
|
} else {
|
||||||
|
$_SESSION["profile"] = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -454,13 +454,9 @@ class Pref_Prefs extends Handler_Protected {
|
|||||||
|
|
||||||
$profile = $_SESSION["profile"];
|
$profile = $_SESSION["profile"];
|
||||||
|
|
||||||
if (!is_numeric($profile) || !$profile || get_schema_version() < 63) $profile = null;
|
|
||||||
|
|
||||||
if ($profile) {
|
if ($profile) {
|
||||||
print_notice(__("Some preferences are only available in default profile."));
|
print_notice(__("Some preferences are only available in default profile."));
|
||||||
}
|
|
||||||
|
|
||||||
if ($_SESSION["profile"]) {
|
|
||||||
initialize_user_prefs($_SESSION["uid"], $profile);
|
initialize_user_prefs($_SESSION["uid"], $profile);
|
||||||
} else {
|
} else {
|
||||||
initialize_user_prefs($_SESSION["uid"]);
|
initialize_user_prefs($_SESSION["uid"]);
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ class RPC extends Handler_Protected {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function setprofile() {
|
function setprofile() {
|
||||||
$_SESSION["profile"] = clean($_REQUEST["id"]);
|
$_SESSION["profile"] = (int) clean($_REQUEST["id"]);
|
||||||
|
|
||||||
// default value
|
// default value
|
||||||
if (!$_SESSION["profile"]) $_SESSION["profile"] = null;
|
if (!$_SESSION["profile"]) $_SESSION["profile"] = null;
|
||||||
|
|||||||
Reference in New Issue
Block a user