Skip to content

Commit

Permalink
Merge branch 'bugfix/triage-compare-deleted-page'
Browse files Browse the repository at this point in the history
  • Loading branch information
albertoleoncio committed Oct 16, 2023
1 parent 232e08e commit ae61b01
Showing 1 changed file with 26 additions and 2 deletions.
28 changes: 26 additions & 2 deletions bin/triage.php
Original file line number Diff line number Diff line change
Expand Up @@ -263,10 +263,34 @@
];
$output['compare'] = unserialize(
file_get_contents($contest['api_endpoint']."?".http_build_query($compare_api_params))
)['compare'];
)['compare'] ?? false;

//Interrope script caso artigo tenha sido eliminado
if (!$output['compare']) {
$reverted_statment = "
UPDATE
`{$contest['name_id']}__edits`
SET
`reverted` = '1'
WHERE
`diff` = ?
";
$reverted_query = mysqli_prepare($con, $reverted_statment);
mysqli_stmt_bind_param($reverted_query, "i", $output['revision']['diff']);
mysqli_stmt_execute($reverted_query);
if (mysqli_stmt_affected_rows($reverted_query) != 0) {
echo "
<script>
alert('".§('modify-label-reverted')." ".$output['revision']['diff']."');
window.location.href = window.location.href;
</script>
";
}
exit();
}

//Coleta informações da edição via API do MediaWiki versão inline
$compare_api_params["difftype"] = "inline";

$output['compare_mobile'] = unserialize(
file_get_contents($contest['api_endpoint']."?".http_build_query($compare_api_params))
)['compare'];
Expand Down

0 comments on commit ae61b01

Please sign in to comment.