Преглед изворни кода

Merge dee3ec7cfe945f0977174749d207f9168d77c545 into 69d67b2b7198d2e1483d7f44d5d4320a63903572

Roberts пре 12 година
родитељ
комит
6c9dffb996
1 измењених фајлова са 12 додато и 0 уклоњено
  1. 12 0
      lib/pico.php

+ 12 - 0
lib/pico.php

@@ -167,6 +167,18 @@ class Pico {
 		}
 		}
 		
 		
 		if($headers['date']) $headers['date_formatted'] = date($config['date_format'], strtotime($headers['date']));
 		if($headers['date']) $headers['date_formatted'] = date($config['date_format'], strtotime($headers['date']));
+		
+		if(empty($headers['title'])){
+			preg_match('/^(.+?)[ ]*\n(=+|-+)[ ]*\n+/imu',$content,$matches);
+			if(count($matches) > 0){
+					$headers['title'] = $matches[1];
+			}else{
+				preg_match('/^\#{1}([^\#].*)$/imu',$content,$matches);
+				if(count($matches) > 0){
+					$headers['title'] = $matches[1];
+				}
+			}
+		}
 
 
 		return $headers;
 		return $headers;
 	}
 	}