]> git.mxchange.org Git - friendica.git/blobdiff - index.php
Merge remote-tracking branch 'friendika/master'
[friendica.git] / index.php
index eb75585c48d909b63838cff51cf113eae44445b8..0c40c07296284cdcdc7cc59a5f7bfeb2adf0d932 100644 (file)
--- a/index.php
+++ b/index.php
@@ -1,7 +1,5 @@
 <?php
 
-error_reporting(E_ERROR | E_WARNING | E_PARSE);
-
 /**
  *
  * Friendika
@@ -29,7 +27,6 @@ $install = ((file_exists('.htconfig.php') && filesize('.htconfig.php')) ? false
 
 @include(".htconfig.php");
 
-
 $lang = get_language();
        
 load_translation_table($lang);
@@ -45,6 +42,21 @@ $db = new dba($db_host, $db_user, $db_pass, $db_data, $install);
         unset($db_host, $db_user, $db_pass, $db_data);
 
 
+if(! $install) {
+
+       /**
+        * Load configs from db. Overwrite configs from .htconfig.php
+        */
+
+       load_config('config');
+       load_config('system');
+
+       require_once("session.php");
+       load_hooks();
+       call_hooks('init_1');
+}
+
+
 /**
  *
  * Important stuff we always need to do.
@@ -57,14 +69,6 @@ $db = new dba($db_host, $db_user, $db_pass, $db_data, $install);
  *
  */
 
-if(! $install) {
-       require_once("session.php");
-       load_hooks();
-       call_hooks('init_1');
-}
-
-
-
 require_once("datetime.php");
 
 $a->timezone = (($default_timezone) ? $default_timezone : 'UTC');
@@ -110,6 +114,9 @@ if(! x($_SESSION,'authenticated'))
 if(! x($_SESSION,'sysmsg'))
        $_SESSION['sysmsg'] = '';
 
+if(! x($_SESSION,'sysmsg_info'))
+       $_SESSION['sysmsg_info'] = '';
+
 /*
  * check_config() is responsible for running update scripts. These automatically 
  * update the DB schema whenever we push a new one out. It also checks to see if
@@ -187,6 +194,12 @@ if(strlen($a->module)) {
         */
 
        if(! $a->module_loaded) {
+
+               // Stupid browser tried to pre-fetch our ACL img template. Don't log the event or return anything - just quietly exit.
+               if((x($_SERVER,'QUERY_STRING')) && strpos($_SERVER['QUERY_STRING'],'{0}') !== false) {
+                       killme();
+               }
+
                if((x($_SERVER,'QUERY_STRING')) && ($_SERVER['QUERY_STRING'] === 'q=internal_error.html') && isset($dreamhost_error_hack)) {
                        logger('index.php: dreamhost_error_hack invoked. Original URI =' . $_SERVER['REQUEST_URI']);
                        goaway($a->get_baseurl() . $_SERVER['REQUEST_URI']);
@@ -262,8 +275,16 @@ if(stristr($_SESSION['sysmsg'], t('Permission denied'))) {
 if(x($_SESSION,'sysmsg')) {
        $a->page['content'] = "<div id=\"sysmsg\" class=\"error-message\">{$_SESSION['sysmsg']}</div>\r\n"
                . ((x($a->page,'content')) ? $a->page['content'] : '');
+       $_SESSION['sysmsg']="";
        unset($_SESSION['sysmsg']);
 }
+if(x($_SESSION,'sysmsg_info')) {
+       $a->page['content'] = "<div id=\"sysmsg_info\" class=\"info-message\">{$_SESSION['sysmsg_info']}</div>\r\n"
+               . ((x($a->page,'content')) ? $a->page['content'] : '');
+       $_SESSION['sysmsg_info']="";
+       unset($_SESSION['sysmsg_info']);
+}
+
 
 
 call_hooks('page_end', $a->page['content']);