소스 검색

fixed loading of file

first check for file.md else for file/index.md
ahmet2106 12 년 전
부모
커밋
cf4fd9024f
1개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. 2 2
      lib/pico.php

+ 2 - 2
lib/pico.php

@@ -37,8 +37,8 @@ class Pico {
 		else $file = CONTENT_DIR .'index';
 
 		// Load the file
-		if(is_dir($file)) $file = CONTENT_DIR . $url .'/index'. CONTENT_EXT;
-		else $file .= CONTENT_EXT;
+		if(file_exists($file.CONTENT_EXT)) $file .= CONTENT_EXT;
+		else if(is_dir($file)) $file = CONTENT_DIR . $url .'/index'. CONTENT_EXT;
 
 		$this->run_hooks('before_load_content', array(&$file));
 		if(file_exists($file)){