The branch, master has been updated
via 5bcca1a6b51aa09a53e023013cbdb561cae37915 (commit)
from 40388d4fe0748d8873682b4983d7081ae478b345 (commit)
- Log -----------------------------------------------------------------
commit 5bcca1a6b51aa09a53e023013cbdb561cae37915
Author: Michal Čihař <mcihar(a)novell.com>
Date: Wed May 5 11:39:24 2010 +0200
Unified error handling by using PMA_fatalError.
-----------------------------------------------------------------------
Summary of changes:
libraries/charset_conversion.lib.php | 16 ++++++++++------
1 files changed, 10 insertions(+), 6 deletions(-)
diff --git a/libraries/charset_conversion.lib.php b/libraries/charset_conversion.lib.php
index 4348453..dbcb4fd 100644
--- a/libraries/charset_conversion.lib.php
+++ b/libraries/charset_conversion.lib.php
@@ -11,6 +11,13 @@ if (! defined('PHPMYADMIN')) {
}
/**
+ * Failure on loading recode/iconv extensions.
+ */
+function PMA_failRecoding() {
+ PMA_fatalError(__('Couldn\'t load the iconv or recode extension needed for
charset conversion. Either configure PHP to enable these extensions or disable charset
conversion in phpMyAdmin.'));
+}
+
+/**
* Loads the recode or iconv extensions if any of it is not loaded yet
*/
if (isset($cfg['AllowAnywhereRecoding'])
@@ -18,14 +25,12 @@ if (isset($cfg['AllowAnywhereRecoding'])
if ($cfg['RecodingEngine'] == 'recode') {
if (!@extension_loaded('recode')) {
- echo __('Couldn\'t load the iconv or recode extension needed for
charset conversion. Either configure PHP to enable these extensions or disable charset
conversion in phpMyAdmin.');
- exit;
+ PMA_failRecoding();
}
$PMA_recoding_engine = 'recode';
} elseif ($cfg['RecodingEngine'] == 'iconv') {
if (!@extension_loaded('iconv')) {
- echo __('Couldn\'t load the iconv or recode extension needed for
charset conversion. Either configure PHP to enable these extensions or disable charset
conversion in phpMyAdmin.');
- exit;
+ PMA_failRecoding();
}
$PMA_recoding_engine = 'iconv';
} else {
@@ -34,8 +39,7 @@ if (isset($cfg['AllowAnywhereRecoding'])
} elseif (@extension_loaded('recode')) {
$PMA_recoding_engine = 'recode';
} else {
- echo __('Couldn\'t load the iconv or recode extension needed for
charset conversion. Either configure PHP to enable these extensions or disable charset
conversion in phpMyAdmin.');
- exit;
+ PMA_failRecoding();
}
}
} // end load recode/iconv extension
hooks/post-receive
--
phpMyAdmin
Show replies by date