aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/acp/acp_reasons.php
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/includes/acp/acp_reasons.php')
-rw-r--r--phpBB/includes/acp/acp_reasons.php14
1 files changed, 11 insertions, 3 deletions
diff --git a/phpBB/includes/acp/acp_reasons.php b/phpBB/includes/acp/acp_reasons.php
index 2234871bce..f94240b925 100644
--- a/phpBB/includes/acp/acp_reasons.php
+++ b/phpBB/includes/acp/acp_reasons.php
@@ -214,9 +214,17 @@ class acp_reasons
case 'mssql':
case 'mssql_odbc':
// Change the reports using this reason to 'other'
- $sql = 'UPDATE ' . REPORTS_TABLE . '
- SET reason_id = ' . $other_reason_id . ", report_text = '" . $db->sql_escape($reason_row['reason_description']) . "\n\n' + report_text
- WHERE reason_id = $reason_id";
+ $sql = "DECLARE @ptrval binary(16)
+
+ SELECT @ptrval = TEXTPTR(report_text)
+ FROM " . REPORTS_TABLE . "
+ WHERE reason_id = " . $reason_id . "
+
+ UPDATETEXT " . REPORTS_TABLE . ".report_text @ptrval 0 0 '" . $db->sql_escape($reason_row['reason_description']) . "\n\n'"
+
+ 'UPDATE ' . REPORTS_TABLE . '
+ SET reason_id = ' . $other_reason_id . "
+ WHERE reason_id = $reason_id";
break;
// Teh standard