Skip to content

Commit

Permalink
Only publish 'legal' pages
Browse files Browse the repository at this point in the history
The republish function now only publishes pages that are returned in the allPagesToCache(); function in the Page class.
  • Loading branch information
Nick Spiel committed Apr 21, 2015
1 parent 4504fd0 commit 0ebd8c7
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion code/extensions/StaticPublisher.php
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,9 @@ public function republish($original) {
}

$urls = array_unique($urls);

$legalPages = singleton('Page')->allPagesToCache();
$urls = array_intersect($urls, $legalPages);

$this->publishPages($urls);
}
Expand Down Expand Up @@ -188,4 +191,4 @@ public function getMetadata($url) {
'Cache generated on ' . date('Y-m-d H:i:s T (O)')
);
}
}
}

0 comments on commit 0ebd8c7

Please sign in to comment.