php 5.2兼容性bug

This commit is contained in:
祁宁
2014-10-11 12:31:13 +08:00
parent 3f3812c305
commit f0b986318a
3 changed files with 4 additions and 2 deletions

View File

@@ -107,6 +107,7 @@ test:
for i in `find ../var/ -name '*.php'`; do php -l $$i; done;
for i in `find ../usr/ -name '*.php'`; do php -l $$i; done;
for i in `find ../admin/ -name '*.php'`; do php -l $$i; done;
php test.php
all:

View File

@@ -204,7 +204,7 @@ class CommonMark_Element_BlockElement
*/
public function getParent()
{
return $this->parent ? : null;
return $this->parent ? $this->parent : null;
}
/**

View File

@@ -242,7 +242,8 @@ class CommonMark_InlineParser
$this->pos++;
}
$charAfter = $this->peek() ? : "\n";
$peek = $this->peek();
$charAfter = $peek ? $peek : "\n";
$canOpen = $numDelims > 0 && $numDelims <= 3 && !preg_match('/\s/', $charAfter);
$canClose = $numDelims > 0 && $numDelims <= 3 && !preg_match('/\s/', $charBefore);