1
0

textile - PHP 5.2 compat workaround

This commit is contained in:
Ian
2014-01-15 15:44:41 +01:00
parent 43bcf4f7d3
commit 9eb675b7e4
2 changed files with 8 additions and 2 deletions

View File

@@ -14,7 +14,7 @@ class serendipity_event_textile extends serendipity_event
$propbag->add('description', PLUGIN_EVENT_TEXTILE_DESC);
$propbag->add('stackable', false);
$propbag->add('author', 'Serendipity Team', 'Lars Strojny');
$propbag->add('version', '1.8');
$propbag->add('version', '1.8.1');
$propbag->add('requirements', array(
'serendipity' => '0.8',
'smarty' => '2.6.7',
@@ -276,7 +276,7 @@ class serendipity_event_textile extends serendipity_event
require_once S9Y_INCLUDE_PATH . 'plugins/serendipity_event_textile/lib3/src/Netcarver/Textile/Parser.php';
require_once S9Y_INCLUDE_PATH . 'plugins/serendipity_event_textile/lib3/src/Netcarver/Textile/DataBag.php';
require_once S9Y_INCLUDE_PATH . 'plugins/serendipity_event_textile/lib3/src/Netcarver/Textile/Tag.php';
$textile = $this->get_config('textile_doctype') ? new \Netcarver\Textile\Parser('html5') : new \Netcarver\Textile\Parser();
include_once 'textile_namespace.inc.php'; // PHP 5.2 compat
// todo check for user-supplied output to restrict
# return $textile->textileRestricted($string);
return $textile->textileThis($string);

View File

@@ -0,0 +1,6 @@
<?php
// workaround for PHP 5.2.x versions to not error while reading code before executing
$textile = $this->get_config('textile_doctype') ? new \Netcarver\Textile\Parser('html5') : new \Netcarver\Textile\Parser();
?>