From 40b132a6868a0abb6cc41a5bc268a78662ccf37c Mon Sep 17 00:00:00 2001 From: ruan Date: Tue, 4 Oct 2016 01:14:19 +0200 Subject: [PATCH] Close cursor after query --- check.php | 2 ++ history.php | 2 ++ inc/page.php | 3 +++ info.php | 3 ++- 4 files changed, 9 insertions(+), 1 deletion(-) diff --git a/check.php b/check.php index 0fb6326..8c84903 100644 --- a/check.php +++ b/check.php @@ -19,6 +19,7 @@ class Check { $uuid = $row['uuid']; } } + $stmt->closeCursor(); if (!isset($uuid)) { $name = htmlspecialchars($name, ENT_QUOTES, 'UTF-8'); $this->println("$name " . $page->lang->check_notjoin); @@ -58,6 +59,7 @@ class Check { $this->println("Banned permanently."); } } + $stmt->closeCursor(); */ } catch (PDOException $ex) { Settings::handle_error($page->settings, $ex); diff --git a/history.php b/history.php index cebfa41..845cfcd 100644 --- a/history.php +++ b/history.php @@ -20,6 +20,7 @@ class History { if ($count_st->execute() && ($row = $count_st->fetch()) !== null) { $counts[$type] = $row['count']; } + $count_st->closeCursor(); $sel = $page->get_selection($table); $limit = $page->settings->limit_per_page; @@ -37,6 +38,7 @@ class History { array_push($array, $row); } } + $st->closeCursor(); } /** diff --git a/inc/page.php b/inc/page.php index a81f484..bddbb21 100644 --- a/inc/page.php +++ b/inc/page.php @@ -135,6 +135,8 @@ class Page { $st->execute(); + $st->closeCursor(); + return $st; } catch (PDOException $ex) { Settings::handle_error($this->settings, $ex); @@ -224,6 +226,7 @@ class Page { $this->uuid_name_cache[$uuid] = $banner; return $banner; } + $stmt->closeCursor(); $this->uuid_name_cache[$uuid] = null; return null; } diff --git a/info.php b/info.php index 17ca4ee..0f6672a 100644 --- a/info.php +++ b/info.php @@ -53,7 +53,7 @@ abstract class Info { class BanInfo extends Info { function basic_info($row, $player_name) { $page = $this->page; - + return array( $page->lang->info_banned_player => $this->punished_avatar($player_name, $row), $page->lang->info_banned_by => $this->moderator_avatar($row), @@ -179,3 +179,4 @@ if ($st->execute(array($id))) { $page->print_footer(); } +$st->closeCursor();