mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-26 20:08:55 +00:00
There might be incorrectly converted smilies in the DB. Let's try to repair them.
git-svn-id: file:///svn/phpbb/trunk@7821 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
45a1efb255
commit
1330f4ffda
1 changed files with 33 additions and 4 deletions
|
@ -620,10 +620,39 @@ if (version_compare($current_version, '3.0.RC1', '<='))
|
||||||
$no_updates = false;
|
$no_updates = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
//if (version_compare($current_version, '3.0.RC2', '<='))
|
if (version_compare($current_version, '3.0.RC2', '<='))
|
||||||
//{
|
{
|
||||||
// $no_updates = false;
|
|
||||||
//}
|
$smileys = array();
|
||||||
|
$sql = 'SELECT smiley_id, code
|
||||||
|
FROM ' . SMILIES_TABLE;
|
||||||
|
|
||||||
|
$result = $db->sql_query($sql);
|
||||||
|
|
||||||
|
while ($row = $db->sql_fetchrow($result))
|
||||||
|
{
|
||||||
|
$smileys[$row['smiley_id']] = $row['code'];
|
||||||
|
}
|
||||||
|
$db->sql_freeresult($result);
|
||||||
|
|
||||||
|
foreach($smileys as $id => $code)
|
||||||
|
{
|
||||||
|
// 2.0 only entitized lt and gt; We need to do something about double quotes.
|
||||||
|
if (strchr($code, '"') === false)
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
$new_code = str_replace('&', '&', $code);
|
||||||
|
$new_code = str_replace('<', '<', $new_code);
|
||||||
|
$new_code = str_replace('>', '>', $new_code);
|
||||||
|
$new_code = utf8_htmlspecialchars($new_code);
|
||||||
|
$sql = 'UPDATE ' . SMILIES_TABLE . '
|
||||||
|
SET code = \'' . $db->sql_escape($new_code) . '\'
|
||||||
|
WHERE smiley_id = ' . (int)$id;
|
||||||
|
$db->sql_query($sql);
|
||||||
|
}
|
||||||
|
$no_updates = false;
|
||||||
|
}
|
||||||
|
|
||||||
_write_result($no_updates, $errored, $error_ary);
|
_write_result($no_updates, $errored, $error_ary);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue