mirror of
https://github.com/phpbb/phpbb.git
synced 2025-05-19 05:49:44 +02:00
Changes: - Ascraeus now uses constants for the phpbb root path and the php extension. This ensures more security for external applications and modifications (no more overwriting of root path and extension possible through insecure mods and register globals enabled) as well as no more globalizing needed. - A second change implemented here is an additional short-hand-notation for append_sid(). It is allowed to omit the root path and extension now (for example calling append_sid('memberlist')) - in this case the root path and extension get added automatically. The hook is called after these are added. git-svn-id: file:///svn/phpbb/trunk@8572 89ea8834-ac86-4346-8a33-228a782c2dd0
48 lines
1.9 KiB
PHP
48 lines
1.9 KiB
PHP
<?php
|
|
/***************************************************************************
|
|
* merge_clean_posts.php
|
|
* -------------------
|
|
* begin : Tuesday, February 25, 2003
|
|
* copyright : (C) 2003 The phpBB Group
|
|
* email : support@phpbb.com
|
|
*
|
|
* $Id$
|
|
*
|
|
***************************************************************************/
|
|
|
|
/***************************************************************************
|
|
*
|
|
* This program is free software; you can redistribute it and/or modify
|
|
* it under the terms of the GNU General Public License as published by
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
* (at your option) any later version.
|
|
*
|
|
***************************************************************************/
|
|
|
|
//
|
|
// Security message:
|
|
//
|
|
// This script is potentially dangerous.
|
|
// Remove or comment the next line (die(".... ) to enable this script.
|
|
// Do NOT FORGET to either remove this script or disable it after you have used it.
|
|
//
|
|
die("Please read the first lines of this script for instructions on how to enable it");
|
|
|
|
@set_time_limit(2400);
|
|
|
|
define('PHPBB_ROOT_PATH', './../');
|
|
define('PHP_EXT', substr(strrchr(__FILE__, '.'), 1));
|
|
include(PHPBB_ROOT_PATH . 'common.' . PHP_EXT);
|
|
|
|
$sql = "SELECT post_id, post_text FROM {$table_prefix}posts WHERE post_text LIKE '%{SMILE_PATH}%'";
|
|
$result = $db->sql_query($sql);
|
|
|
|
while ($row = $db->sql_fetchrow($result))
|
|
{
|
|
$db->sql_query("UPDATE {$table_prefix}posts SET post_text = '" . $db->sql_escape(str_replace('{SMILE_PATH}', '{SMILIES_PATH}', $row['post_text'])) . "' WHERE post_id = " . $row['post_id']);
|
|
}
|
|
$db->sql_freeresult($result);
|
|
|
|
echo "<p><b>Done</b></p>\n";
|
|
|
|
?>
|