Skip to content

Commit

Permalink
Fix bug when sections are patched without content
Browse files Browse the repository at this point in the history
  • Loading branch information
BafS committed Feb 19, 2016
1 parent 62fe162 commit f104636
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions Parvula/Core/PageRenderer/FlatFilesPageRenderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public function __construct(
}

/**
* Render page to string
* Render Page object to string
*
* @param Page $page
* @return string Rendered page
Expand Down Expand Up @@ -120,7 +120,7 @@ public function render(Page $page) {
}

/**
* Decode string data to create a page object
* Decode string data to create a Page object
*
* @param mixed $data Data using to create the page
* @param array ($options) default page field(s)
Expand All @@ -138,8 +138,7 @@ public function parse($data, array $options = [], $parseContent = true) {
if (!empty($pageTokens[1])) {
// Split into sections
$content = preg_split(
$this->sectionMatcher, $pageTokens[1] . ' ', -1,
PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE);
$this->sectionMatcher, $pageTokens[1] . ' ', -1, PREG_SPLIT_DELIM_CAPTURE);

if (($len = count($content)) > 1) {
for ($i = 1; $i < $len; ++$i) {
Expand Down

0 comments on commit f104636

Please sign in to comment.