]> git.mxchange.org Git - friendica.git/blobdiff - index.php
Correct content type
[friendica.git] / index.php
index a62b7a2ea1ff2e5cc52390857ee1294408ebf541..46b95c75e4bfe0b0962b81f7f54cbea9ad763179 100644 (file)
--- a/index.php
+++ b/index.php
@@ -215,10 +215,6 @@ if (strlen($a->module)) {
         * First see if we have an addon which is masquerading as a module.
         */
 
-       if ($a->module == 'object') {
-               $a->module = 'display';
-       }
-
        // Compatibility with the Android Diaspora client
        if ($a->module == 'stream') {
                goaway('network?f=&order=post');
@@ -346,15 +342,21 @@ if ($a->module_loaded) {
        $a->page['page_title'] = $a->module;
        $placeholder = '';
 
+       Addon::callHooks($a->module . '_mod_init', $placeholder);
+
        if ($a->module_class) {
-               Addon::callHooks($a->module . '_mod_init', $placeholder);
                call_user_func([$a->module_class, 'init']);
        } else if (function_exists($a->module . '_init')) {
-               Addon::callHooks($a->module . '_mod_init', $placeholder);
                $func = $a->module . '_init';
                $func($a);
        }
 
+       // "rawContent" is especially meant for technical endpoints.
+       // This endpoint doesn't need any theme initialization or other comparable stuff.
+       if (!$a->error && $a->module_class) {
+               call_user_func([$a->module_class, 'rawContent']);
+       }
+
        if (function_exists(str_replace('-', '_', $a->getCurrentTheme()) . '_init')) {
                $func = str_replace('-', '_', $a->getCurrentTheme()) . '_init';
                $func($a);