]> git.mxchange.org Git - mailer.git/blobdiff - inc/db/lib.php
Extensions 'admins' and 'task' are now always active
[mailer.git] / inc / db / lib.php
index 6bc4e7397186c0398adb11eb27ef14e86c4c8f45..4384bfea813a58fa0e813a765fa08055e6f6d573 100644 (file)
@@ -32,8 +32,7 @@
  ************************************************************************/
 
 // Some security stuff...
-if (ereg(basename(__FILE__), $_SERVER['PHP_SELF']))
-{
+if (!defined('__SECURITY')) {
        $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
        require($INC);
 }
@@ -42,18 +41,18 @@ if (ereg(basename(__FILE__), $_SERVER['PHP_SELF']))
 if (_DB_TYPE == "_DB_TYPE") define('_DB_TYPE', "mysql3");
 
 // Create include file name
-$INC = PATH."inc/db/lib-"._DB_TYPE.".php";
+$INC = sprintf("%sinc/db/lib-%s.php", PATH, _DB_TYPE);
 
-if (file_exists($INC))
-{
+if ((file_exists($INC)) && (is_readable($INC))) {
        // Include abstraction layer
        require_once($INC);
-}
- else
-{
+} else {
        // Bye, bye...
        die("Cannot load database abstraction layer! R.I.P.");
 }
 
+// Remove this globally used variable
+unset($INC);
+
 //
 ?>