summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorspiderr <spiderr@bitweaver.org>2021-01-31 15:49:08 -0500
committerspiderr <spiderr@bitweaver.org>2021-01-31 15:49:08 -0500
commit71cbc7db147f95c78fc3b26d61fc31ad3c6bc0fb (patch)
treece46484ab0b09a8e2b83caf71cff7335693f0649
parentd9d215a4a116dce855582c319303f87462b972b3 (diff)
downloadwiki-71cbc7db147f95c78fc3b26d61fc31ad3c6bc0fb.tar.gz
wiki-71cbc7db147f95c78fc3b26d61fc31ad3c6bc0fb.tar.bz2
wiki-71cbc7db147f95c78fc3b26d61fc31ad3c6bc0fb.zip
PHP7 clean up dual static + object use of parseData, and create ->getParsedData & ::filterDataHash
-rw-r--r--BitPage.php2
-rw-r--r--display_bitpage_inc.php2
-rw-r--r--edit.php12
-rw-r--r--print_multi_pages.php5
-rwxr-xr-xslideshow.php2
-rw-r--r--wiki_rss.php2
6 files changed, 10 insertions, 15 deletions
diff --git a/BitPage.php b/BitPage.php
index 043feee..7a3680b 100644
--- a/BitPage.php
+++ b/BitPage.php
@@ -194,7 +194,7 @@ class BitPage extends LibertyMime implements BitCacheable {
}
if ( $parse ) {
- $this->mInfo['parsed_data'] = $this->parseData();
+ $this->getParsedData();
}
} else {
$this->mPageId = NULL;
diff --git a/display_bitpage_inc.php b/display_bitpage_inc.php
index 4154b41..ba8e63b 100644
--- a/display_bitpage_inc.php
+++ b/display_bitpage_inc.php
@@ -116,7 +116,7 @@ if( $gBitSystem->isFeatureActive( 'wiki_comments' )) {
// Footnotes
if( $gBitSystem->isFeatureActive( 'wiki_footnotes' ) && $gBitUser->isValid() ) {
if( $footnote = $gContent->getFootnote( $gBitUser->mUserId ) ) {
- $gBitSmarty->assign( 'footnote', $gContent->parseData( $footnote ) );
+ $gBitSmarty->assign( 'footnote', LibertyContent::parseDataHash( $footnote ) );
}
}
diff --git a/edit.php b/edit.php
index 3a083c7..76b2cb3 100644
--- a/edit.php
+++ b/edit.php
@@ -73,10 +73,10 @@ if( $gBitSystem->isFeatureActive( 'wiki_footnotes' ) ) {
$gBitSmarty->assign( 'footnote', $footnote );
if( $footnote )
$gBitSmarty->assign( 'has_footnote', 'y' );
- $gBitSmarty->assign( 'parsed_footnote', $gContent->parseData( $footnote ) );
+ $gBitSmarty->assign( 'parsed_footnote', LibertyContent::parseDataHash( $footnote ) );
if( isset( $_REQUEST['footnote'] ) ) {
- $gBitSmarty->assign( 'parsed_footnote', $gContent->parseData( $_REQUEST['footnote'] ) );
+ $gBitSmarty->assign( 'parsed_footnote', LibertyContent::parseDataHash( $_REQUEST['footnote'] ) );
$gBitSmarty->assign( 'footnote', $_REQUEST['footnote'] );
$gBitSmarty->assign( 'has_footnote', 'y' );
if( empty( $_REQUEST['footnote'] ) ) {
@@ -210,16 +210,12 @@ if( isset( $_REQUEST["preview"] ) ) {
$formInfo['edit_section'] = 1;
}
- $data_to_parse = $formInfo['edit'];
+ $data_to_parse['data'] = $formInfo['edit'];
if( !empty( $formInfo['section'] ) && !empty( $gContent->mInfo['data'] )) {
$full_page_data = $gContent->mInfo['data'];
}
-
- $formInfo['parsed_data'] = $gContent->parseData(
- $data_to_parse,
- ( !empty( $_REQUEST['format_guid'] ) ? $_REQUEST['format_guid'] : ( isset( $gContent->mInfo['format_guid'] ) ? $gContent->mInfo['format_guid'] : 'tikiwiki' ))
- );
+ $formInfo['parsed_data'] = LibertyContent::parseDataHash( $data_to_parse );
$gContent->invokeServices( 'content_preview_function' );
}
diff --git a/print_multi_pages.php b/print_multi_pages.php
index acd4063..0fafcc5 100644
--- a/print_multi_pages.php
+++ b/print_multi_pages.php
@@ -31,9 +31,8 @@ if (isset($_REQUEST["print"])) {
$page = new BitPage( NULL, $contentId );
if( $page->load() ) {
$page->verifyViewPermission();
- $page_info = $page->mInfo;
- $page_info["parsed"] = $page->parseData( $page_info );
- $pages[] = $page_info;
+ $page->getParsedData();
+ $pages[] = $page->mInfo;
}
}
}
diff --git a/slideshow.php b/slideshow.php
index d403b9b..137ae2f 100755
--- a/slideshow.php
+++ b/slideshow.php
@@ -72,7 +72,7 @@ if (isset($reqs[1][$_REQUEST["slide"]])) {
$slide_title = '';
}
-$slide_data = $gContent->parseData( $slides[$_REQUEST["slide"] + 1] );
+$slide_data = LibertyContent::parseDataHash( $slides[$_REQUEST["slide"] + 1] );
if (isset($reqs[1][$_REQUEST["slide"] - 1])) {
$slide_prev_title = $reqs[1][$_REQUEST["slide"] - 1];
diff --git a/wiki_rss.php b/wiki_rss.php
index d616c5b..f3eadb1 100644
--- a/wiki_rss.php
+++ b/wiki_rss.php
@@ -43,7 +43,7 @@ if( !$gBitUser->hasPermission( 'p_wiki_view_page' ) ) {
$item = new FeedItem();
$item->title = $feed['title'];
$item->link = BIT_BASE_URI.$wiki->getDisplayUrl( $feed['title'] );
- $item->description = $wiki->parseData( $feed );
+ $item->description = BitPage::parseDataHash( $feed );
$item->date = ( int )$feed['last_modified'];
$item->source = 'http://'.$_SERVER['HTTP_HOST'].BIT_ROOT_URL;