aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/install
diff options
context:
space:
mode:
authorNathaniel Guse <nathaniel.guse@gmail.com>2013-07-11 10:09:53 -0500
committerNathaniel Guse <nathaniel.guse@gmail.com>2013-07-11 10:09:53 -0500
commitece01f0a1f31ac45761043dbc3515374a4a81dc8 (patch)
tree95d7d7a56bf19b904b88db69b017f4e2b13ff7b5 /phpBB/install
parent13c087d4f10944ea646fc9fa1ba10a8dc368ceb3 (diff)
parent9210d735a53e3c4a4de042b49dae361c436268e1 (diff)
downloadforums-ece01f0a1f31ac45761043dbc3515374a4a81dc8.tar
forums-ece01f0a1f31ac45761043dbc3515374a4a81dc8.tar.gz
forums-ece01f0a1f31ac45761043dbc3515374a4a81dc8.tar.bz2
forums-ece01f0a1f31ac45761043dbc3515374a4a81dc8.tar.xz
forums-ece01f0a1f31ac45761043dbc3515374a4a81dc8.zip
Merge remote-tracking branch 'remotes/nickv/ticket/8319' into develop-olympus
# By Joas Schilling # Via Joas Schilling * remotes/nickv/ticket/8319: [ticket/8319] Do not repeat the replacement [ticket/8319] Add explanation for RELATIVE_URL and update LOCAL_URL [ticket/8319] Update BBCodes that currently use the LOCAL_URL tag on update [ticket/8319] Add new token RELATIVE_URL to allow foreign relative URL parts [ticket/8319] Prepend Board URL to LOCAL_URL links to prevent abuse
Diffstat (limited to 'phpBB/install')
-rw-r--r--phpBB/install/database_update.php30
1 files changed, 30 insertions, 0 deletions
diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php
index 8aa62af7e1..a0ca05a129 100644
--- a/phpBB/install/database_update.php
+++ b/phpBB/install/database_update.php
@@ -2204,6 +2204,36 @@ function change_database_data(&$no_updates, $version)
_sql($sql, $errored, $error_ary);
}
+ /**
+ * Update BBCodes that currently use the LOCAL_URL tag
+ *
+ * To fix http://tracker.phpbb.com/browse/PHPBB3-8319 we changed
+ * the second_pass_replace value, so that needs updating for existing ones
+ */
+ $sql = 'SELECT *
+ FROM ' . BBCODES_TABLE . '
+ WHERE bbcode_match ' . $db->sql_like_expression($db->any_char . 'LOCAL_URL' . $db->any_char);
+ $result = $db->sql_query($sql);
+
+ while ($row = $db->sql_fetchrow($result))
+ {
+ if (!class_exists('acp_bbcodes'))
+ {
+ phpbb_require_updated('includes/acp/acp_bbcodes.' . $phpEx);
+ }
+ $bbcode_match = $row['bbcode_match'];
+ $bbcode_tpl = $row['bbcode_tpl'];
+
+ $acp_bbcodes = new acp_bbcodes();
+ $sql_ary = $acp_bbcodes->build_regexp($bbcode_match, $bbcode_tpl);
+
+ $sql = 'UPDATE ' . BBCODES_TABLE . '
+ SET ' . $db->sql_build_array('UPDATE', $sql_ary) . '
+ WHERE bbcode_id = ' . (int) $row['bbcode_id'];
+ $db->sql_query($sql);
+ }
+ $db->sql_freeresult($result);
+
$no_updates = false;
break;
}