forked from GNUsocial/gnu-social
take an argument for fixup_utf8
This commit is contained in:
parent
121cb6afb1
commit
daf845dbe6
@ -35,7 +35,7 @@ define('LACONICA', true);
|
|||||||
require_once(INSTALLDIR . '/lib/common.php');
|
require_once(INSTALLDIR . '/lib/common.php');
|
||||||
require_once('DB.php');
|
require_once('DB.php');
|
||||||
|
|
||||||
function main() {
|
function fixup_utf8($id) {
|
||||||
|
|
||||||
$dbl = doConnect('latin1');
|
$dbl = doConnect('latin1');
|
||||||
|
|
||||||
@ -58,8 +58,16 @@ function main() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$rn = $dbl->query('SELECT id, content, rendered FROM notice ' .
|
$sql = 'SELECT id, content, rendered FROM notice ' .
|
||||||
'WHERE LENGTH(content) != CHAR_LENGTH(content)');
|
'WHERE LENGTH(content) != CHAR_LENGTH(content)';
|
||||||
|
|
||||||
|
if (!empty($id)) {
|
||||||
|
$sql .= ' AND id < ' . $id;
|
||||||
|
}
|
||||||
|
|
||||||
|
$sql .= ' ORDER BY id DESC';
|
||||||
|
|
||||||
|
$rn = $dbl->query($sql);
|
||||||
|
|
||||||
if (PEAR::isError($rn)) {
|
if (PEAR::isError($rn)) {
|
||||||
echo "ERROR: " . $rn->getMessage() . "\n";
|
echo "ERROR: " . $rn->getMessage() . "\n";
|
||||||
@ -128,4 +136,6 @@ function doConnect($charset)
|
|||||||
return $db;
|
return $db;
|
||||||
}
|
}
|
||||||
|
|
||||||
main();
|
$id = ($argc > 1) ? $argv[1] : null;
|
||||||
|
|
||||||
|
fixup_utf8($id);
|
||||||
|
Loading…
Reference in New Issue
Block a user