Skip to content

Commit

Permalink
fixed previous attempt to fix metadata for externally edited pages
Browse files Browse the repository at this point in the history
darcs-hash:20090228232625-7ad00-d0f0e8569d60f65d511994b401dd4c469bc44f60.gz
  • Loading branch information
splitbrain committed Feb 28, 2009
1 parent 482cff9 commit ef47e29
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions inc/parser/metadata.php
Expand Up @@ -37,6 +37,14 @@ function getFormat(){
}

function document_start(){
global $ID;
// external pages are missing create date
if(!$this->persistent['date']['created']){
$this->persistent['date']['created'] = filectime(wikiFN($ID));
}
if(!isset($this->persistent['creator'])){
$this->persistent['creator'] = '';
}
// reset metadata to persistent values
$this->meta = $this->persistent;
}
Expand All @@ -57,19 +65,10 @@ function document_end(){

$this->meta['relation']['firstimage'] = $this->firstimage;

// create missing data on externally created pages

if(!$this->meta['date']['modified']){
$this->meta['date']['modified'] = filemtime(wikiFN($ID));
}

if(!$this->meta['date']['created']){
$this->meta['date']['created'] = $this->meta['date']['modified'];
}

if(!isset($this->meta['creator'])){
$this->meta['creator'] = '';
}
}

function toc_additem($id, $text, $level) {
Expand Down

0 comments on commit ef47e29

Please sign in to comment.