Bläddra i källkod

Pages are now parsed by PHP first.

Gustave Abel Michel III 10 år sedan
förälder
incheckning
84d036d23e
1 ändrade filer med 8 tillägg och 2 borttagningar
  1. 8 2
      lib/pico.php

+ 8 - 2
lib/pico.php

@@ -47,10 +47,16 @@ class Pico {
 
 		$this->run_hooks('before_load_content', array(&$file));
 		if(file_exists($file)){
-			$content = file_get_contents($file);
+			ob_start();
+			include($file);
+			$content = ob_get_contents();
+			ob_end_clean();
 		} else {
 			$this->run_hooks('before_404_load_content', array(&$file));
-			$content = file_get_contents($settings['content_dir'] .'404'. CONTENT_EXT);
+			ob_start();
+			include($settings['content_dir'] .'404'. CONTENT_EXT);
+			$content = ob_get_contents();
+			ob_end_clean();
 			header($_SERVER['SERVER_PROTOCOL'].' 404 Not Found');
 			$this->run_hooks('after_404_load_content', array(&$file, &$content));
 		}