Skip to content

Commit 75a02bc

Browse files
committed
Fix incorrect usages of sql_fetchfield
Signed-off-by: Matt Friedman <maf675@gmail.com>
1 parent ba3b783 commit 75a02bc

File tree

5 files changed

+12
-12
lines changed

5 files changed

+12
-12
lines changed

manage/tool/contribution/resync_count.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ public function get_total()
208208
);
209209
$sql = $this->db->sql_build_query('SELECT', $sql_ary);
210210
$result = $this->db->sql_query($sql);
211-
$this->total = (int) $this->db->sql_fetchfield('cnt', $result);
211+
$this->total = (int) $this->db->sql_fetchfield('cnt');
212212
$this->db->sql_freeresult($result);
213213
}
214214

manage/tool/contribution/update_release_topics.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ public function get_total()
9393
)) . '
9494
AND ' . $this->db->sql_in_set('contrib_type', $types);
9595
$result = $this->db->sql_query($sql);
96-
$this->total = (int) $this->db->sql_fetchfield('cnt', $result);
96+
$this->total = (int) $this->db->sql_fetchfield('cnt');
9797
$this->db->sql_freeresult($result);
9898
}
9999
else

manage/tool/search/reindex.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ protected function get_contrib_count()
114114
$sql = 'SELECT COUNT(contrib_id) AS cnt
115115
FROM ' . $this->contribs_table;
116116
$result = $this->db->sql_query($sql);
117-
$total = (int) $this->db->sql_fetchfield('cnt', $result);
117+
$total = (int) $this->db->sql_fetchfield('cnt');
118118
$this->db->sql_freeresult($result);
119119

120120
return $total;
@@ -130,7 +130,7 @@ protected function get_faq_count()
130130
$sql = 'SELECT COUNT(faq_id) AS cnt
131131
FROM ' . $this->contrib_faq_table;
132132
$result = $this->db->sql_query($sql);
133-
$total = (int) $this->db->sql_fetchfield('cnt', $result);
133+
$total = (int) $this->db->sql_fetchfield('cnt');
134134
$this->db->sql_freeresult($result);
135135

136136
return $total;
@@ -146,7 +146,7 @@ protected function get_post_count()
146146
$sql = 'SELECT COUNT(post_id) AS cnt
147147
FROM ' . $this->posts_table;
148148
$result = $this->db->sql_query($sql);
149-
$total = (int) $this->db->sql_fetchfield('cnt', $result);
149+
$total = (int) $this->db->sql_fetchfield('cnt');
150150
$this->db->sql_freeresult($result);
151151

152152
return $total;

manage/tool/topic/resync_dots.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public function get_total()
6868
WHERE post_approved = 1
6969
AND post_deleted = 0';
7070
$result = $this->db->sql_query($sql);
71-
$this->total = (int) $this->db->sql_fetchfield('cnt', $result);
71+
$this->total = (int) $this->db->sql_fetchfield('cnt');
7272
$this->db->sql_freeresult($result);
7373
}
7474

sync.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ public function contribs($mode, $contrib_id = false, $start = false, $limit = fa
252252
WHERE contrib_id = ' . $row['contrib_id'] . '
253253
AND revision_status = ' . ext::TITANIA_REVISION_APPROVED;
254254
$result1 = $this->db->sql_query($sql);
255-
$cnt = $this->db->sql_fetchfield('cnt', $result1);
255+
$cnt = $this->db->sql_fetchfield('cnt', false, $result1);
256256
$this->db->sql_freeresult($result1);
257257

258258
if (($cnt > 0 && $row['contrib_status'] == ext::TITANIA_CONTRIB_NEW) || ($cnt == 0 && $row['contrib_status'] == ext::TITANIA_CONTRIB_APPROVED))
@@ -631,7 +631,7 @@ public function _get_post_count($topic_id)
631631
AND post_deleted = 0
632632
AND post_approved = 1';
633633
$result = $this->db->sql_query($sql);
634-
$teams = $this->db->sql_fetchfield('cnt', $result);
634+
$teams = $this->db->sql_fetchfield('cnt', false, $result);
635635
$this->db->sql_freeresult($result);
636636

637637
$sql = 'SELECT COUNT(post_id) AS cnt
@@ -641,7 +641,7 @@ public function _get_post_count($topic_id)
641641
AND post_deleted = 0
642642
AND post_approved = 1';
643643
$result = $this->db->sql_query($sql);
644-
$authors = $this->db->sql_fetchfield('cnt', $result);
644+
$authors = $this->db->sql_fetchfield('cnt', false, $result);
645645
$this->db->sql_freeresult($result);
646646

647647
$sql = 'SELECT COUNT(post_id) AS cnt
@@ -651,15 +651,15 @@ public function _get_post_count($topic_id)
651651
AND post_deleted = 0
652652
AND post_approved = 1';
653653
$result = $this->db->sql_query($sql);
654-
$public = $this->db->sql_fetchfield('cnt', $result);
654+
$public = $this->db->sql_fetchfield('cnt', false, $result);
655655
$this->db->sql_freeresult($result);
656656

657657
$sql = 'SELECT COUNT(post_id) AS cnt
658658
FROM ' . $this->posts_table . '
659659
WHERE topic_id = ' . (int) $topic_id . '
660660
AND post_deleted <> 0';
661661
$result = $this->db->sql_query($sql);
662-
$deleted = $this->db->sql_fetchfield('cnt', $result);
662+
$deleted = $this->db->sql_fetchfield('cnt', false, $result);
663663
$this->db->sql_freeresult($result);
664664

665665
$sql = 'SELECT COUNT(post_id) AS cnt
@@ -668,7 +668,7 @@ public function _get_post_count($topic_id)
668668
AND post_deleted = 0
669669
AND post_approved = 0';
670670
$result = $this->db->sql_query($sql);
671-
$unapproved = $this->db->sql_fetchfield('cnt', $result);
671+
$unapproved = $this->db->sql_fetchfield('cnt', false, $result);
672672
$this->db->sql_freeresult($result);
673673

674674
return count::to_db(array(

0 commit comments

Comments
 (0)