Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions SETUP/MediaWiki_extensions/hospitalExtensions.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,5 @@ function listHospitalProjects($input, $argv)
$output .= "</td></tr>\n";
$output .= "</table>\n";
}

mysqli_free_result($result);
return $output;
}
2 changes: 0 additions & 2 deletions SETUP/document_database.php
Original file line number Diff line number Diff line change
Expand Up @@ -243,8 +243,6 @@ function query_columns_for_table(string $table_name): array
}

$rows = mysqli_fetch_all($result, MYSQLI_ASSOC);
mysqli_free_result($result);

return $rows;
}

Expand Down
2 changes: 0 additions & 2 deletions SETUP/tests/unittests/phpunit_test_helpers.inc
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,6 @@ function create_test_image_source(string $image_source): void
if (!$result) {
throw new Exception(sprintf("Unable to create test image source %s", $image_source));
}
} else {
mysqli_free_result($result);
}
}

Expand Down
1 change: 0 additions & 1 deletion pinc/CharSuites.inc
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,6 @@ class CharSuites
while ($row = mysqli_fetch_assoc($result)) {
$charsuites[] = CharSuites::get($row["name"]);
}
mysqli_free_result($result);
return $charsuites;
}

Expand Down
1 change: 0 additions & 1 deletion pinc/JsonStorage.inc
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ class JsonStorage
while ($row = mysqli_fetch_assoc($result)) {
$value = $row['value'];
}
mysqli_free_result($result);
return $value;
}

Expand Down
2 changes: 0 additions & 2 deletions pinc/NonactivatedUser.inc
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,6 @@ class NonactivatedUser
)
);
}

mysqli_free_result($result);
}

public function save(): void
Expand Down
5 changes: 0 additions & 5 deletions pinc/Project.inc
Original file line number Diff line number Diff line change
Expand Up @@ -905,7 +905,6 @@ class Project
while ($row = mysqli_fetch_assoc($result)) {
$projectids[] = $row['projectid'];
}
mysqli_free_result($result);
return $projectids;
}

Expand Down Expand Up @@ -1013,7 +1012,6 @@ class Project
while ($row = mysqli_fetch_assoc($result)) {
$charsuites[] = CharSuites::get($row["charsuite_name"]);
}
mysqli_free_result($result);
return $charsuites;
}

Expand Down Expand Up @@ -1247,8 +1245,6 @@ class Project
while ($row = mysqli_fetch_assoc($res)) {
$states[] = $row["state"];
}
mysqli_free_result($res);

return $states;
}

Expand Down Expand Up @@ -2154,7 +2150,6 @@ function load_image_sources(): array
while ($row = mysqli_fetch_assoc($result)) {
$image_sources[(string)$row['code_name']] = $row;
}
mysqli_free_result($result);
return $image_sources;
}

Expand Down
4 changes: 0 additions & 4 deletions pinc/RandomRule.inc
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ class RandomRule

$result = DPDatabase::query($sql);
$row = mysqli_fetch_assoc($result);
mysqli_free_result($result);
if (!$row) {
return null;
}
Expand All @@ -106,7 +105,6 @@ class RandomRule
);
$result = DPDatabase::query($sql);
$row = mysqli_fetch_assoc($result);
mysqli_free_result($result);
if (!$row) {
return null;
}
Expand Down Expand Up @@ -138,7 +136,6 @@ class RandomRule
while ($row = mysqli_fetch_assoc($result)) {
$rules[] = new RandomRule($row["id"]);
}
mysqli_free_result($result);
return $rules;
}

Expand Down Expand Up @@ -168,7 +165,6 @@ class RandomRule
'count' => $row['count'],
];
}
mysqli_free_result($result);
return $summary;
}

Expand Down
3 changes: 0 additions & 3 deletions pinc/Settings.inc
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ class Settings
while ($row = mysqli_fetch_assoc($result)) {
$this->_load_value($row['setting'], $row['value']);
}
mysqli_free_result($result);
}

public function UserName(): string
Expand Down Expand Up @@ -306,8 +305,6 @@ class Settings
while ($row = mysqli_fetch_assoc($result)) {
$usernames[] = $row['username'];
}
mysqli_free_result($result);

return $usernames;
}
}
2 changes: 0 additions & 2 deletions pinc/TallyBoard.inc
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,6 @@ class TallyBoard

$r++;
}
mysqli_free_result($result);

// we need to pull the same data from the users table but with a
// current_tally of 0 to populate $neighbors
Expand All @@ -342,7 +341,6 @@ class TallyBoard
);
$result = DPDatabase::query($sql);
$row = mysqli_fetch_assoc($result);
mysqli_free_result($result);
$rank = $ranker->next($row["current_tally"]);
$row["current_rank"] = $rank;
$neighbors[0] = $row;
Expand Down
1 change: 0 additions & 1 deletion pinc/Team.inc
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ class Team

$result = DPDatabase::query($sql);
[$count] = mysqli_fetch_row($result);
mysqli_free_result($result);
return $count;
}
}
5 changes: 0 additions & 5 deletions pinc/User.inc
Original file line number Diff line number Diff line change
Expand Up @@ -291,8 +291,6 @@ class User
)
);
}

mysqli_free_result($result);
}

public function save(): void
Expand All @@ -316,7 +314,6 @@ class User
while ($row = mysqli_fetch_assoc($result)) {
$teams[] = $row["t_id"];
}
mysqli_free_result($result);
return $teams;
}

Expand Down Expand Up @@ -536,8 +533,6 @@ class User
$is_valid = true;
}
}

mysqli_free_result($result);
return $is_valid;
}

Expand Down
3 changes: 0 additions & 3 deletions pinc/UserProfile.inc
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,6 @@ class UserProfile
);
}
$this->table_row = mysqli_fetch_assoc($result);

mysqli_free_result($result);
}

public function save(): void
Expand Down Expand Up @@ -184,7 +182,6 @@ class UserProfile
while ($row = mysqli_fetch_assoc($result)) {
$profiles[] = new UserProfile((int)$row["id"]);
}
mysqli_free_result($result);
return $profiles;
}
}
1 change: 0 additions & 1 deletion pinc/UserSuggestions.inc
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,6 @@ class UserSuggestions
while ([$count, $value] = mysqli_fetch_row($result)) {
$field_counts[$value] = $count;
}
mysqli_free_result($result);
return $field_counts;
}
}
13 changes: 0 additions & 13 deletions pinc/forum_interface_phpbb3.inc
Original file line number Diff line number Diff line change
Expand Up @@ -444,8 +444,6 @@ function get_forum_user_id(string $username): ?int
$res = DPDatabase::query($query);

$row = mysqli_fetch_assoc($res);
mysqli_free_result($res);

if (!$row) {
return null;
}
Expand Down Expand Up @@ -473,8 +471,6 @@ function get_forum_rank_title(int $rank): ?string
$res = DPDatabase::query($query);

$row = mysqli_fetch_assoc($res);
mysqli_free_result($res);

return $row["rank_title"] ?? null;
}

Expand Down Expand Up @@ -628,8 +624,6 @@ function get_number_of_unread_messages(string $username): ?int
$res = DPDatabase::query($query);

[$num_messages] = mysqli_fetch_row($res);
mysqli_free_result($res);

return $num_messages;
}

Expand All @@ -650,9 +644,6 @@ function does_topic_exist(int $topic_id): bool
$res = DPDatabase::query($query);

$exists = (mysqli_num_rows($res) > 0);

mysqli_free_result($res);

return $exists;
}

Expand All @@ -676,8 +667,6 @@ function get_last_post_time_in_topic(int $topic_id): ?int
$res = DPDatabase::query($query);

$row = mysqli_fetch_assoc($res);
mysqli_free_result($res);

return $row["max_post_time"] ?? null;
}

Expand Down Expand Up @@ -713,8 +702,6 @@ function get_topic_details(int $topic_id): ?array
$res = DPDatabase::query($query);

$row = mysqli_fetch_assoc($res);
mysqli_free_result($res);

return $row;
}

Expand Down
1 change: 0 additions & 1 deletion pinc/graph_data.inc
Original file line number Diff line number Diff line change
Expand Up @@ -776,7 +776,6 @@ function get_round_backlog_stats(array $interested_phases): array
while ($result = mysqli_fetch_assoc($res)) {
$stats[$phase] = $result["num_pages"] ?? 0; // SELECT SUM() WHERE 0; returns NULL
}
mysqli_free_result($res);
}

// Pop off any trailing phases that have no pages.
Expand Down
3 changes: 0 additions & 3 deletions pinc/showavailablebooks.inc
Original file line number Diff line number Diff line change
Expand Up @@ -588,9 +588,6 @@ function show_project_listing(
}

echo "</table>";

// Free the search results.
mysqli_free_result($result);
}

// -----------------------------------------------------------------------------
Expand Down
9 changes: 0 additions & 9 deletions pinc/wordcheck_engine.inc
Original file line number Diff line number Diff line change
Expand Up @@ -735,9 +735,6 @@ function count_wordcheck_suggestion_events(string $projectid, int $start_time =
$res = DPDatabase::query($sql);

$row = mysqli_fetch_assoc($res);

mysqli_free_result($res);

return $row["numevents"];
}

Expand Down Expand Up @@ -771,9 +768,6 @@ function load_wordcheck_events(string $projectid, int $start_time = 0): array

$eventArray[] = [$time, $round, $page, $proofer, $words];
}

mysqli_free_result($res);

return $eventArray;
}

Expand All @@ -796,9 +790,6 @@ function load_project_good_word_suggestions_flat(string $projectid, int $start_t
while ([$suggestions] = mysqli_fetch_row($res)) {
$words = array_merge($words, explode("\n", $suggestions));
}

mysqli_free_result($res);

return $words;
}

Expand Down
1 change: 0 additions & 1 deletion tasks.php
Original file line number Diff line number Diff line change
Expand Up @@ -1266,7 +1266,6 @@ function load_task(int $tid, bool $is_assoc = true)
} else {
$task = mysqli_fetch_object($result);
}
mysqli_free_result($result);
return $task;
}

Expand Down
3 changes: 0 additions & 3 deletions tools/project_manager/edit_project_word_lists.php
Original file line number Diff line number Diff line change
Expand Up @@ -440,9 +440,6 @@ public function number_of_pages_in_round(?Round $round): int

$res = DPDatabase::query($sql);
$count = mysqli_fetch_row($res);

mysqli_free_result($res);

return $count[0];
}
}
1 change: 0 additions & 1 deletion tools/project_manager/show_image_sources.php
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,5 @@ function load_image_source_stats(): array
while ($row = mysqli_fetch_assoc($result)) {
$stats[(string)$row['image_source']] = $row;
}
mysqli_free_result($result);
return $stats;
}
2 changes: 0 additions & 2 deletions tools/project_manager/show_project_wordcheck_usage.php
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,6 @@

echo "</tr>\n";
}
mysqli_free_result($res);

?>
</table>
<?php
1 change: 0 additions & 1 deletion tools/project_manager/show_word_context.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@
break;
}
}
mysqli_free_result($pages_res);

if ($foundInstances >= $wordInstances) {
echo "<p>" . _("More instances were found; please choose how many to show from the drop-down.") . "</p>";
Expand Down
1 change: 0 additions & 1 deletion tools/proofers/review_work.php
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,6 @@ function _echo_round_select(array $rounds, ?Round $selected_round): void
while ([$image] = mysqli_fetch_row($result)) {
$diffLinkString .= "<a href='../project_manager/diff.php?project=$projectid&amp;image=$image&amp;L_round=$work_round->id&amp;R_round=$review_round->id'>$image</a> ";
}
mysqli_free_result($result);
}

// not sure why the pages that have been saved in the review round
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@
$option_value = urlencode($language);
echo "<option value='$option_value'>$option_string</option>";
}
mysqli_free_result($res);
echo "</select>";
echo "</td>";
echo "</tr>";
Expand Down