diff options
author | zotlabs <mike@macgirvin.com> | 2017-03-14 17:07:29 -0700 |
---|---|---|
committer | zotlabs <mike@macgirvin.com> | 2017-03-14 17:07:29 -0700 |
commit | 2c73b457ef0943d46804480a0aa016f64c11edbf (patch) | |
tree | 330baac97f28e61a3e8daed75e5736fdaae7a28c /Zotlabs/Lib | |
parent | 2f5f1a4d641c5873c308d6ab58ae239f2758e1e4 (diff) | |
download | volse-hubzilla-2c73b457ef0943d46804480a0aa016f64c11edbf.tar.gz volse-hubzilla-2c73b457ef0943d46804480a0aa016f64c11edbf.tar.bz2 volse-hubzilla-2c73b457ef0943d46804480a0aa016f64c11edbf.zip |
input filter updates
Diffstat (limited to 'Zotlabs/Lib')
-rw-r--r-- | Zotlabs/Lib/MarkdownSoap.php | 2 | ||||
-rw-r--r-- | Zotlabs/Lib/NativeWikiPage.php | 31 |
2 files changed, 3 insertions, 30 deletions
diff --git a/Zotlabs/Lib/MarkdownSoap.php b/Zotlabs/Lib/MarkdownSoap.php index d0481eb4d..2dcaaec9a 100644 --- a/Zotlabs/Lib/MarkdownSoap.php +++ b/Zotlabs/Lib/MarkdownSoap.php @@ -5,7 +5,7 @@ namespace Zotlabs\Lib; /** * MarkdownSoap * Purify Markdown for storage - * $x = newMarkdownSoap($string_to_be_cleansed); + * $x = new MarkdownSoap($string_to_be_cleansed); * $text = $x->clean(); * * What this does: diff --git a/Zotlabs/Lib/NativeWikiPage.php b/Zotlabs/Lib/NativeWikiPage.php index 941ade90c..9f54081a1 100644 --- a/Zotlabs/Lib/NativeWikiPage.php +++ b/Zotlabs/Lib/NativeWikiPage.php @@ -307,34 +307,6 @@ class NativeWikiPage { return null; } - - - static public function prepare_content($s) { - - $text = preg_replace_callback('{ - (?:\n\n|\A\n?) - ( # $1 = the code block -- one or more lines, starting with a space/tab - (?> - [ ]{'.'4'.'} # Lines must start with a tab or a tab-width of spaces - .*\n+ - )+ - ) - ((?=^[ ]{0,'.'4'.'}\S)|\Z) # Lookahead for non-space at line-start, or end of doc - }xm', - 'self::nwiki_prepare_content_callback', $s); - - return $text; - } - - static public function nwiki_prepare_content_callback($matches) { - $codeblock = $matches[1]; - - $codeblock = htmlspecialchars($codeblock, ENT_NOQUOTES, UTF8, false); - return "\n\n" . $codeblock ; - } - - - static public function save_page($arr) { $pageUrlName = ((array_key_exists('pageUrlName',$arr)) ? $arr['pageUrlName'] : ''); @@ -352,7 +324,8 @@ class NativeWikiPage { $mimetype = $w['mimeType']; if($mimetype === 'text/markdown') { - $content = purify_html(Zlib\NativeWikiPage::prepare_content($content)); + $x = new Zlib\MarkdownSoap($content); + $content = $x->clean(); } else { $content = escape_tags($content); |