1
0
mirror of https://github.com/ezyang/htmlpurifier.git synced 2025-08-03 04:37:39 +02:00

Make module compatible with Phorum 5.2.6. Changes:

- Modify signature/edit message handling to account for <phorum break>
- Update line numbers
- Update edit message fragile code
- Prevent message blanking when signature or edit message is empty
- Armor source for quote
- Update bbcode function call
- Use phorum_db_interact for our custom call

git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1499 48356398-32a2-884e-a903-53898d9a118a
This commit is contained in:
Edward Z. Yang
2008-01-13 01:58:34 +00:00
parent 57f897661e
commit 8a17b1fbc3
4 changed files with 14 additions and 26 deletions

View File

@@ -46,7 +46,7 @@ function phorum_htmlpurifier_migrate_sigs($offset) {
$fake_data = array(array("author"=>"", "email"=>"", "subject"=>"", 'body' => $sig));
list($fake_message) = phorum_htmlpurifier_migrate($fake_data);
$user['signature'] = $fake_message['body'];
if (!phorum_user_save($user)) {
if (!phorum_api_user_save($user)) {
exit('Error while saving user data');
}
}
@@ -55,17 +55,7 @@ function phorum_htmlpurifier_migrate_sigs($offset) {
// query for highest ID in database
$type = $PHORUM['DBCONFIG']['type'];
$sql = "select MAX(user_id) from {$PHORUM['user_table']}";
if ($type == 'mysql') {
$conn = phorum_db_mysql_connect();
$res = mysql_query($sql, $conn);
$row = mysql_fetch_row($res);
} elseif ($type == 'mysqli') {
$conn = phorum_db_mysqli_connect();
$res = mysqli_query($conn, $sql);
$row = mysqli_fetch_row($res);
} else {
exit('Unrecognized database!');
}
$row = phorum_db_interact(DB_RETURN_ROW, $sql);
$top_id = (int) $row[0];
$offset += $increment;