Merged in changes by @addvilz
This commit is contained in:
commit
641f7c334d
1 changed files with 14 additions and 3 deletions
17
lib/pico.php
17
lib/pico.php
|
@ -162,8 +162,20 @@ class Pico {
|
|||
$headers[$field] = trim($matches[2][$m]);
|
||||
}
|
||||
}
|
||||
|
||||
if(isset($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;
|
||||
}
|
||||
|
@ -340,4 +352,3 @@ class Pico {
|
|||
|
||||
}
|
||||
|
||||
// End of file
|
||||
|
|
Loading…
Add table
Reference in a new issue