diff options
| author | Henry Sudhof <kellanved@phpbb.com> | 2010-04-08 00:04:47 +0200 |
|---|---|---|
| committer | Andreas Fischer <bantu@phpbb.com> | 2010-07-31 01:48:13 +0200 |
| commit | 47557fd4d2037915845f9fcfe863cea539eea7ac (patch) | |
| tree | 984b06a37c51f28087ba26acfc04ce982351a770 /phpBB | |
| parent | 925a135613a80ba9bfc3b26a2524d3c2d3ba77b3 (diff) | |
| download | forums-47557fd4d2037915845f9fcfe863cea539eea7ac.tar forums-47557fd4d2037915845f9fcfe863cea539eea7ac.tar.gz forums-47557fd4d2037915845f9fcfe863cea539eea7ac.tar.bz2 forums-47557fd4d2037915845f9fcfe863cea539eea7ac.tar.xz forums-47557fd4d2037915845f9fcfe863cea539eea7ac.zip | |
[ticket/9521] Fix error reporting for the native SQL Server plugin.
The native SQL Server plugin used to return an error string when calling
sql_error. However, some error condition checks are done using is_array.
This patch wraps the error into an array to follow the error logic used
elsewhere.
PHPBB3-9521
Diffstat (limited to 'phpBB')
| -rwxr-xr-x[-rw-r--r--] | phpBB/includes/db/mssqlnative.php | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/phpBB/includes/db/mssqlnative.php b/phpBB/includes/db/mssqlnative.php index 08ee70907c..76595ca873 100644..100755 --- a/phpBB/includes/db/mssqlnative.php +++ b/phpBB/includes/db/mssqlnative.php @@ -502,6 +502,7 @@ class dbal_mssqlnative extends dbal { $errors = @sqlsrv_errors(SQLSRV_ERR_ERRORS); $error_message = ''; + $code = 0; if ($errors != null) { @@ -509,6 +510,7 @@ class dbal_mssqlnative extends dbal { $error_message .= "SQLSTATE: ".$error[ 'SQLSTATE']."\n"; $error_message .= "code: ".$error[ 'code']."\n"; + $code = $error['code']; $error_message .= "message: ".$error[ 'message']."\n"; } $this->last_error_result = $error_message; @@ -518,7 +520,11 @@ class dbal_mssqlnative extends dbal { $error = (isset($this->last_error_result) && $this->last_error_result) ? $this->last_error_result : array(); } - return $error; + + return array( + 'message' => $error, + 'code' => $code, + ); } /** |
