Skip to content

Commit

Permalink
fix performance issues
Browse files Browse the repository at this point in the history
  • Loading branch information
0bitus committed Sep 25, 2018
1 parent a2b3f5e commit c615dbc
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions process/subscription.php
Expand Up @@ -27,10 +27,13 @@
echo Helper::jsonResponse(FALSE, "error", $LOCAL["msg"]["error"]["empty_termsconditions"]); echo Helper::jsonResponse(FALSE, "error", $LOCAL["msg"]["error"]["empty_termsconditions"]);
exit(); exit();
} }
if (!empty($_POST["offset"])) {
$offset = intval($_POST["offset"]);
}
$keyHandler = new KeyHandler(); $keyHandler = new KeyHandler();
$subscription = new Subscription($_SESSION["user"]["uID"]); $subscription = new Subscription($_SESSION["user"]["uID"]);
$keys = explode("\n", $_POST["keys"]); $keys = explode("\n", $_POST["keys"]);
$count = 0; $count = !empty($offset) ? $offset : 0;
foreach ($keys as $key) { foreach ($keys as $key) {
$key = trim($key); $key = trim($key);
if (!empty($key)) { if (!empty($key)) {
Expand Down Expand Up @@ -59,7 +62,7 @@
break; break;


case "setpass": case "setpass":
$passExpression = "/^[".$CONF["pass_filter"]."]+$/"; $passExpression = "/^[" . $CONF["pass_filter"] . "]+$/";
if (empty($_POST["target"]) || !is_numeric($_POST["target"])) { if (empty($_POST["target"]) || !is_numeric($_POST["target"])) {
echo Helper::jsonResponse(FALSE, "error", $LOCAL["msg"]["error"]["no_subscription_id"]); echo Helper::jsonResponse(FALSE, "error", $LOCAL["msg"]["error"]["no_subscription_id"]);
exit(); exit();
Expand Down

0 comments on commit c615dbc

Please sign in to comment.