diff --git a/attachment.php b/attachment.php index faa3e13d..0d1e6b13 100644 --- a/attachment.php +++ b/attachment.php @@ -12,7 +12,7 @@ $count_left = $Attach->get_count_left(); $size_limit = $Attach->get_size_limit_byte(); $allowed_exts = $Attach->get_allowed_ext(); $css_uri = get_css_uri(); -$altsize = $_POST['altsize']; +$altsize = $_POST['altsize'] ?? ''; ?> diff --git a/classes/class_cache_redis.php b/classes/class_cache_redis.php index 0c42d304..9913f6c1 100644 --- a/classes/class_cache_redis.php +++ b/classes/class_cache_redis.php @@ -209,7 +209,7 @@ class RedisCache { // $this->set($Key,$Value, 0, $Duration); $this->redis->set($Key, $Value, $Duration); $this->cacheWriteTimes++; - $this->keyHits['write'][$Key] = !$this->keyHits['write'][$Key] ? 1 : $this->keyHits['write'][$Key]+1; + $this->keyHits['write'][$Key] = !isset($this->keyHits['write'][$Key]) ? 1 : $this->keyHits['write'][$Key]+1; } //---------- Getting functions ----------// @@ -219,7 +219,7 @@ class RedisCache { function next_row(){ $this->Row++; $this->Part = 0; - if($this->Page[$this->Row] == false){ + if(!isset($this->Page[$this->Row]) || $this->Page[$this->Row] == false){ return false; } elseif(count($this->Page[$this->Row]) == 1){ @@ -276,7 +276,7 @@ class RedisCache { $Return = $this->redis->get($Key); $Return = ! is_null($Return) ? $this->unserialize($Return) : null; $this->cacheReadTimes++; - $this->keyHits['read'][$Key] = !$this->keyHits['read'][$Key] ? 1 : $this->keyHits['read'][$Key]+1; + $this->keyHits['read'][$Key] = !isset($this->keyHits['read'][$Key]) ? 1 : $this->keyHits['read'][$Key]+1; return $Return; } diff --git a/confirm.php b/confirm.php index 0b46fb33..23da0edd 100644 --- a/confirm.php +++ b/confirm.php @@ -40,7 +40,7 @@ else // when it's op, default is not use secure login $securelogin_indentity_cookie = false; $passh = md5($row["passhash"]); } -logincookie($row["id"], $passh,1,0x7fffffff,$securelogin_indentity_cookie); +logincookie($id, $passh,1,0x7fffffff,$securelogin_indentity_cookie); //sessioncookie($row["id"], $passh,false); header("Refresh: 0; url=ok.php?type=confirm"); diff --git a/donate.php b/donate.php index 97d84e66..e784500d 100644 --- a/donate.php +++ b/donate.php @@ -5,7 +5,7 @@ require_once(get_langfile_path()); if ($enabledonation != 'yes') stderr($lang_donate['std_sorry'], $lang_donate['std_do_not_accept_donation']); -$do = $_GET['do']; +$do = $_GET['do'] ?? ''; if ($do == 'thanks') { stderr($lang_donate['std_success'], $lang_donate['std_donation_success_note_one']."".$lang_donate['std_here']."".$lang_donate['std_donation_success_note_two'], false); diff --git a/faq.php b/faq.php index e86b0923..3d78246a 100644 --- a/faq.php +++ b/faq.php @@ -24,17 +24,17 @@ if (!$is_rulelang){ } $res = sql_query("SELECT `id`, `link_id`, `question`, `flag` FROM `faq` WHERE `type`='categ' AND `lang_id` = ".sqlesc($lang_id)." ORDER BY `order` ASC"); while ($arr = mysql_fetch_array($res)) { - $faq_categ[$arr[link_id]][title] = $arr[question]; - $faq_categ[$arr[link_id]][flag] = $arr[flag]; - $faq_categ[$arr[link_id]][link_id] = $arr[link_id]; + $faq_categ[$arr['link_id']]['title'] = $arr['question']; + $faq_categ[$arr['link_id']]['flag'] = $arr['flag']; + $faq_categ[$arr['link_id']]['link_id'] = $arr['link_id']; } $res = sql_query("SELECT `id`, `link_id`, `question`, `answer`, `flag`, `categ` FROM `faq` WHERE `type`='item' AND `lang_id` = ".sqlesc($lang_id)." ORDER BY `order` ASC"); -while ($arr = mysql_fetch_array($res, MYSQL_BOTH)) { - $faq_categ[$arr[categ]][items][$arr[id]][question] = $arr[question]; - $faq_categ[$arr[categ]][items][$arr[id]][answer] = $arr[answer]; - $faq_categ[$arr[categ]][items][$arr[id]][flag] = $arr[flag]; - $faq_categ[$arr[categ]][items][$arr[id]][link_id] = $arr[link_id]; +while ($arr = mysql_fetch_array($res)) { + $faq_categ[$arr['categ']]['items'][$arr['id']]['question'] = $arr['question']; + $faq_categ[$arr['categ']]['items'][$arr['id']]['answer'] = $arr['answer']; + $faq_categ[$arr['categ']]['items'][$arr['id']]['flag'] = $arr['flag']; + $faq_categ[$arr['categ']]['items'][$arr['id']]['link_id'] = $arr['link_id']; } if (isset($faq_categ)) { @@ -44,11 +44,11 @@ if (isset($faq_categ)) { { if (!array_key_exists("title", $faq_categ[$id])) { - foreach ($faq_categ[$id][items] as $id2 => $temp) + foreach ($faq_categ[$id]['items'] as $id2 => $temp) { - $faq_orphaned[$id2][question] = $faq_categ[$id][items][$id2][question]; - $faq_orphaned[$id2][answer] = $faq_categ[$id][items][$id2][answer]; - $faq_orphaned[$id2][flag] = $faq_categ[$id][items][$id2][flag]; + $faq_orphaned[$id2]['question'] = $faq_categ[$id]['items'][$id2]['question']; + $faq_orphaned[$id2][answer] = $faq_categ[$id]['items'][$id2][answer]; + $faq_orphaned[$id2]['flag'] = $faq_categ[$id]['items'][$id2]['flag']; unset($faq_categ[$id]); } } @@ -58,16 +58,16 @@ if (isset($faq_categ)) { begin_frame("".$lang_faq['text_contents'] . ""); foreach ($faq_categ as $id => $temp) { - if ($faq_categ[$id][flag] == "1") + if ($faq_categ[$id]['flag'] == "1") { - print("