tinyfilemanager icon indicating copy to clipboard operation
tinyfilemanager copied to clipboard

Unable to preview, edit a php file that returns a 404 header

Open smalos opened this issue 3 years ago • 1 comments

A php file contains this code:

  if(array_key_exists('REQUEST_URI', $_SERVER)){
        if(strpos($_SERVER['REQUEST_URI'], basename(__FILE__)) !== false){
            header('HTTP/1.0 404 Not Found', true, 404);
            die();
        }
    }

Now if you preview or edit that file in tinyfilemanager, you will see a 404 error in the browser instead of the actual php code.

Shouldn't the viewer/editor etc. work regardless of the content of a .php file?

smalos avatar Aug 04 '22 22:08 smalos

BTW, this happens just in the embedded mode:

define('FM_EMBED', true);

smalos avatar Aug 04 '22 22:08 smalos