From 7e4af642c93da5af9889211cff169c901e35d6b8 Mon Sep 17 00:00:00 2001 From: Lester Caine Date: Thu, 14 May 2026 09:54:15 +0100 Subject: php-cs-fixer tidies to php8.5 standards Co-Authored-By: Claude Sonnet 4.6 --- plugins/data.addjstabs.php | 8 +-- plugins/data.addtabs.php | 4 +- plugins/data.adsense.php | 7 ++- plugins/data.agentinfo.php | 23 ++++---- plugins/data.alias.php | 4 +- plugins/data.attachment.php | 4 +- plugins/data.biticon.php | 3 +- plugins/data.code.php | 10 ++-- plugins/data.comment.php | 3 +- plugins/data.copyright.php | 9 +-- plugins/data.countdown.php | 34 +++++------ plugins/data.creationtime.php | 5 +- plugins/data.div.php | 4 +- plugins/data.dropdown.php | 5 +- plugins/data.example.php | 5 +- plugins/data.geshidata.php | 7 ++- plugins/data.googleviewer.php | 7 ++- plugins/data.graphviz.php | 17 +++--- plugins/data.img.php | 3 +- plugins/data.include.php | 4 +- plugins/data.jstabs.php | 7 +-- plugins/data.ledgertable.php | 117 +++++++++++++++++++------------------- plugins/data.module.php | 5 +- plugins/data.object.php | 7 +-- plugins/data.pluginhelp.php | 3 +- plugins/data.pre.php | 4 +- plugins/data.quote.php | 6 +- plugins/data.renderer.php | 3 +- plugins/data.sort.php | 4 +- plugins/data.span.php | 4 +- plugins/data.textarea.php | 4 +- plugins/data.toc.php | 4 +- plugins/data.video.php | 3 +- plugins/data.youtube.php | 11 ++-- plugins/filter.attachment.php | 3 +- plugins/filter.backtotop.php | 7 ++- plugins/filter.bitlinks.php | 12 +--- plugins/filter.htmlpurifier.php | 35 ++++++------ plugins/filter.maketoc.php | 7 ++- plugins/filter.simplepurifier.php | 2 +- plugins/filter.stylepurifier.php | 8 +-- plugins/filter.urlcache.php | 8 +-- plugins/format.bbcode.php | 6 +- plugins/format.bithtml.php | 2 +- plugins/format.markdown.php | 2 +- plugins/format.simpletext.php | 2 +- plugins/format.tikiwiki.php | 8 +-- plugins/mime.application.php | 5 +- plugins/mime.audio.php | 1 + plugins/mime.default.php | 6 +- plugins/mime.image.php | 5 +- plugins/mime.pbase.php | 1 + plugins/mime.pdf.php | 4 +- plugins/mime.video.php | 9 ++- plugins/processor.gd.php | 8 +-- plugins/processor.imagick.php | 3 +- plugins/processor.magickwand.php | 1 + plugins/storage.bitfile.php | 10 ++-- 58 files changed, 254 insertions(+), 249 deletions(-) (limited to 'plugins') diff --git a/plugins/data.addjstabs.php b/plugins/data.addjstabs.php index 61a779b..9e37554 100755 --- a/plugins/data.addjstabs.php +++ b/plugins/data.addjstabs.php @@ -1,7 +1,7 @@ KernelTools::tra("Will join the contents from several sources in a Tabbed Interface."), 'help_function' => 'data_addjstabs_help', 'syntax' => "{ADDTABS tab1= tab2= tab3= . . . tab99= }", - 'plugin_type' => DATA_PLUGIN + 'plugin_type' => DATA_PLUGIN, ]; $gLibertySystem->registerPlugin( PLUGIN_GUID_DATAADDJSTABS, $pluginParams ); $gLibertySystem->registerDataTag( $pluginParams['tag'], PLUGIN_GUID_DATAADDJSTABS ); @@ -97,7 +97,7 @@ function data_addjstabs($data, $params) { } if( !empty( $html )) { return \Bitweaver\Liberty\smarty_block_jstabs( [], $html, $gBitSmarty, '' ); - } else { - return $html; } + return $html; + } diff --git a/plugins/data.addtabs.php b/plugins/data.addtabs.php index de49b25..f470f67 100755 --- a/plugins/data.addtabs.php +++ b/plugins/data.addtabs.php @@ -1,7 +1,7 @@ KernelTools::tra("Will join the contents from several sources in a Tabbed Interface."), 'help_function' => '\data_addtabs_help', 'syntax' => "{ADDTABS tab1= tab2= tab3= . . . tab99= }", - 'plugin_type' => DATA_PLUGIN + 'plugin_type' => DATA_PLUGIN, ]; $gLibertySystem->registerPlugin( PLUGIN_GUID_DATAADDTABS, $pluginParams ); $gLibertySystem->registerDataTag( $pluginParams['tag'], PLUGIN_GUID_DATAADDTABS ); diff --git a/plugins/data.adsense.php b/plugins/data.adsense.php index b8af0c9..698a691 100755 --- a/plugins/data.adsense.php +++ b/plugins/data.adsense.php @@ -1,6 +1,7 @@ 'ADSENSE', 'auto_activate' => false, 'requires_pair' => false, @@ -40,8 +41,8 @@ $pluginParams = array ( 'description' => KernelTools::tra("This plugin adds Adsense Code to page."), 'help_function' => '\data_adsense_help', 'syntax' => "{ADSENSE}", - 'plugin_type' => DATA_PLUGIN -); + 'plugin_type' => DATA_PLUGIN, +]; $gLibertySystem->registerPlugin( PLUGIN_GUID_DATAADSENSE, $pluginParams ); $gLibertySystem->registerDataTag( $pluginParams['tag'], PLUGIN_GUID_DATAADSENSE ); diff --git a/plugins/data.agentinfo.php b/plugins/data.agentinfo.php index b2b7cf5..9d07784 100755 --- a/plugins/data.agentinfo.php +++ b/plugins/data.agentinfo.php @@ -1,6 +1,7 @@ KernelTools::tra("This plugin will display the viewer's IP address, the Browser they are using, or the info about the site's Server software."), 'help_function' => '\data_agentinfo_help', 'syntax' => "{AGENTINFO info= }", - 'plugin_type' => DATA_PLUGIN + 'plugin_type' => DATA_PLUGIN, ]; $gLibertySystem->registerPlugin( PLUGIN_GUID_DATAAGENTINFO, $pluginParams ); $gLibertySystem->registerDataTag( $pluginParams['tag'], PLUGIN_GUID_DATAAGENTINFO ); @@ -69,19 +70,19 @@ function data_agentinfo_help() { // Load Function function data_agentinfo($data, $params) { - $info = 'IP'; + $info = 'IP'; extract ($params, EXTR_SKIP); switch (strtoupper ($info)) { case 'SVRSW': // To maintain Pre-Clyde Parameters - case 'SERVER': - $ret = $_SERVER["SERVER_SOFTWARE"]; - return $ret; - case 'BROWSER': - $ret = $_SERVER["HTTP_USER_AGENT"]; - return $ret; - default: - $ret = $_SERVER["REMOTE_ADDR"]; - return $ret; + case 'SERVER': + $ret = $_SERVER["SERVER_SOFTWARE"]; + return $ret; + case 'BROWSER': + $ret = $_SERVER["HTTP_USER_AGENT"]; + return $ret; + default: + $ret = $_SERVER["REMOTE_ADDR"]; + return $ret; } } diff --git a/plugins/data.alias.php b/plugins/data.alias.php index ea44644..9c3eb75 100755 --- a/plugins/data.alias.php +++ b/plugins/data.alias.php @@ -1,7 +1,7 @@ KernelTools::tra( "This plugin allows you to easily create an alias for a page." ), 'help_function' => '\data_alias_help', 'syntax' => "{alias page='title'}", - 'plugin_type' => DATA_PLUGIN + 'plugin_type' => DATA_PLUGIN, ]; $gLibertySystem->registerPlugin( PLUGIN_GUID_DATAalias, $pluginParams ); $gLibertySystem->registerDataTag( $pluginParams['tag'], PLUGIN_GUID_DATAalias ); diff --git a/plugins/data.attachment.php b/plugins/data.attachment.php index f1c0167..b3fcc68 100755 --- a/plugins/data.attachment.php +++ b/plugins/data.attachment.php @@ -1,8 +1,7 @@ registerPlugin( PLUGIN_GUID_DATAATTACHMENT, $pluginParams ); $gLibertySystem->registerDataTag( $pluginParams['tag'], PLUGIN_GUID_DATAATTACHMENT ); - function data_attachment_help() { $help = '' diff --git a/plugins/data.biticon.php b/plugins/data.biticon.php index 70462f5..da40c68 100755 --- a/plugins/data.biticon.php +++ b/plugins/data.biticon.php @@ -1,6 +1,7 @@ KernelTools::tra( "Display any bitweaver icon" ), 'help_function' => '\data_biticon_help', 'syntax' => '{biticon ipackage= iname= iexplain=}', - 'plugin_type' => DATA_PLUGIN + 'plugin_type' => DATA_PLUGIN, ]; $gLibertySystem->registerPlugin( PLUGIN_GUID_DATABITICON, $pluginParams ); $gLibertySystem->registerDataTag( $pluginParams['tag'], PLUGIN_GUID_DATABITICON ); diff --git a/plugins/data.code.php b/plugins/data.code.php index db070ad..3cf90dd 100755 --- a/plugins/data.code.php +++ b/plugins/data.code.php @@ -1,7 +1,6 @@ ' => '#004A4A">', // Color for Functions/Variables/Numbers/&/Constants @@ -251,8 +249,8 @@ function data_code( $pData, $pParams ) { // Pre-Clyde Changes // Color for Constants '#FF9900">' => '#BB4040">', // Color for Strings - '#CC0000">' => '#903030">' - ); + '#CC0000">' => '#903030">', + ]; // <-- # Assigned by HighLight_String / --> # Color to be Displayed // NOTE: The colors assigned by HighLight_String have changed with different versions of PHP - these are for PHP 4.3.4 // Change the Colors diff --git a/plugins/data.comment.php b/plugins/data.comment.php index b5cbef4..6db25ea 100755 --- a/plugins/data.comment.php +++ b/plugins/data.comment.php @@ -1,6 +1,7 @@ KernelTools::tra("This plugin allows Comments (Text that will not be displayed) to be added to a page."), 'help_function' => '\data__comment_help', 'syntax' => "{comment}Data Not Displayed{/comment}", - 'plugin_type' => DATA_PLUGIN + 'plugin_type' => DATA_PLUGIN, ]; $gLibertySystem->registerPlugin( PLUGIN_GUID_DATACOMMENT, $pluginParams ); $gLibertySystem->registerDataTag( $pluginParams['tag'], PLUGIN_GUID_DATACOMMENT ); diff --git a/plugins/data.copyright.php b/plugins/data.copyright.php index 9011acb..eb052e4 100755 --- a/plugins/data.copyright.php +++ b/plugins/data.copyright.php @@ -1,6 +1,7 @@ KernelTools::tra("This plugin is used to insert CopyRight notices."), 'help_function' => '\data_copyright_help', 'syntax' => "{COPYRIGHT title= year= authors= }", - 'plugin_type' => DATA_PLUGIN + 'plugin_type' => DATA_PLUGIN, ]; $gLibertySystem->registerPlugin( PLUGIN_GUID_DATACOPYRIGHT, $pluginParams ); $gLibertySystem->registerDataTag( $pluginParams['tag'], PLUGIN_GUID_DATACOPYRIGHT ); @@ -97,9 +98,9 @@ function data_copyright($data, $params) { // Pre-Clyde Changes $pos2 = strlen($data) - $pos1; $authors = substr( $data, $pos1, $pos2); } else { - $title = isset( $title) ? $title : ' '; - $year = isset( $year) ? $year : ' '; - $authors = isset( $authors) ? $authors : ' '; + $title = $title ?? ' '; + $year = $year ?? ' '; + $authors = $authors ?? ' '; } $ret = 'The plugin "' . $pluginParams['tag'] . '" has not been completed as yet. '; return $ret; diff --git a/plugins/data.countdown.php b/plugins/data.countdown.php index ecab8a9..330d36c 100755 --- a/plugins/data.countdown.php +++ b/plugins/data.countdown.php @@ -1,6 +1,7 @@ 'COUNTDOWN', 'auto_activate' => false, 'requires_pair' => false, @@ -38,8 +39,8 @@ $pluginParams = array ( 'description' => KernelTools::tra("Displays a Count-Down until a date:time is reached - then - negative numbers indicate how long it has been since that date. The Count-Down is displayed in the format of (X days, X hours, X minutes and X seconds)."), 'help_function' => '\data_countdown_help', 'syntax' => "{COUNTDOWN enddate= localtime= class= punct= text=}", - 'plugin_type' => DATA_PLUGIN -); + 'plugin_type' => DATA_PLUGIN, +]; $gLibertySystem->registerPlugin( PLUGIN_GUID_DATACOUNTDOWN, $pluginParams ); $gLibertySystem->registerDataTag( $pluginParams['tag'], PLUGIN_GUID_DATACOUNTDOWN ); @@ -66,17 +67,17 @@ function data_countdown_help() { .'' .'' .'' - .'' + .'' .'' .'' .'' .'' - .'' + .'' .'' .'' .'' .'' - .'' + .'' .'
class' . KernelTools::tra( "string") . '
' . KernelTools::tra("(optional)") . '
' . KernelTools::tra( "Classname of the SPAN surrounding the countdown. The date/time segments are each wrapped in a VAR-Tag. Default = countdown") . '
punct' . KernelTools::tra( "string") . '
' . KernelTools::tra("(optional)") . '
' . KernelTools::tra( "Any kind of punctuation to divide the date/time segments from each other, a comma, a colon, a pipe ... Default = space. To put a non breaking space, use HTML: &nbsp;") . '
text' . KernelTools::tra( "string") . '
' . KernelTools::tra("(optional)") . '
' . KernelTools::tra( "Text to be displayed after the date/time string. It's wrapped in <em>.") . '
' .'

' . KernelTools::tra("Example 1: ") . '

' .'

' . KernelTools::tra("Example 2: ") . '

' @@ -90,26 +91,26 @@ function data_countdown($data,$params) { global $gLibertySystem; $pluginParams = $gLibertySystem->mPlugins[PLUGIN_GUID_DATACOUNTDOWN]; extract ($params, EXTR_SKIP); - + if (!isset($enddate) ) { // The Mandatory Parameter is missing $ret = KernelTools::tra("The required parameter ") . "enddate" . KernelTools::tra(" was missing from the plugin ") . '"' . $pluginParams['tag'] . '"'; $ret.= data_countdown_help(); return $ret; } - + $then = strtotime ($enddate); - + if ($then == -1) { // strtotime failed so enddate was not a valid date $ret = KernelTools::tra("__Error__ - The plugin ") . '"' . $pluginParams['tag'] . '"' . KernelTools::tra(" was not given a valid date. The date given was:\n") . "enddate=$enddate"; return $ret; } - + $tz = isset($localtime) && $localtime == 'on' && isset($_COOKIE['tz_offset']) ? $_COOKIE['tz_offset'] : 0; - + if (!isset($class)) { $class = 'countdown'; } - + if (!isset($punct)) { $punct = " "; } @@ -118,17 +119,16 @@ function data_countdown($data,$params) { $text = ""; } - $now = strtotime ("now") + $tz; $difference = $then - $now; $num = $difference/86400; - $days = intval($num); + $days = (int) $num; $num2 = ($num - $days)*24; - $hours = intval($num2); + $hours = (int) $num2; $num3 = ($num2 - $hours)*60; - $mins = intval($num3); + $mins = (int) $num3; $num4 = ($num3 - $mins)*60; - $secs = intval($num4); + $secs = (int) $num4; $ret = " " . "" . $days . " " . KernelTools::tra("days") . "" . $punct diff --git a/plugins/data.creationtime.php b/plugins/data.creationtime.php index 7d0b33d..ea3a848 100755 --- a/plugins/data.creationtime.php +++ b/plugins/data.creationtime.php @@ -1,7 +1,6 @@ KernelTools::tra("This plugin will display the creation time of a page."), 'help_function' => '\data_creationtime_help', 'syntax' => "{creationtime}", - 'plugin_type' => DATA_PLUGIN + 'plugin_type' => DATA_PLUGIN, ]; $gLibertySystem->registerPlugin( PLUGIN_GUID_DATA_CREATIONTIME, $pluginParams ); $gLibertySystem->registerDataTag( $pluginParams['tag'], PLUGIN_GUID_DATA_CREATIONTIME ); @@ -47,7 +46,7 @@ function data_creationtime_help() { return KernelTools::tra( "Example: " )."{creationtime}
"; } -//The actual handler for the plugin +//The actual handler for the plugin function data_creationtime( $data, $params, &$pCommonObject ) { return \Bitweaver\Liberty\smarty_modifier_bit_short_datetime( $pCommonObject->mInfo['created'] ); } diff --git a/plugins/data.div.php b/plugins/data.div.php index 1caee93..5c57c67 100755 --- a/plugins/data.div.php +++ b/plugins/data.div.php @@ -1,7 +1,7 @@ KernelTools::tra( "This plugin allows you to easily create a div with a number of optional CSS parameters." ), 'help_function' => '\data_div_help', 'syntax' => "{div border='3px solid blue'}", - 'plugin_type' => DATA_PLUGIN + 'plugin_type' => DATA_PLUGIN, ]; $gLibertySystem->registerPlugin( PLUGIN_GUID_DATADIV, $pluginParams ); $gLibertySystem->registerDataTag( $pluginParams['tag'], PLUGIN_GUID_DATADIV ); diff --git a/plugins/data.dropdown.php b/plugins/data.dropdown.php index 861b05d..4c1eee6 100755 --- a/plugins/data.dropdown.php +++ b/plugins/data.dropdown.php @@ -1,6 +1,7 @@ KernelTools::tra("This plugin creates a expandable box of text. All text should be entered between the ") . "{DD} " . KernelTools::tra("blocks."), 'help_function' => '\data_dropdown_help', 'syntax' => "{DD title= width= }" . KernelTools::tra("Text in the Drop-Down box.") . "{DD}", - 'plugin_type' => DATA_PLUGIN + 'plugin_type' => DATA_PLUGIN, ]; $gLibertySystem->registerPlugin( PLUGIN_GUID_DATADROPDOWN, $pluginParams ); $gLibertySystem->registerDataTag( $pluginParams['tag'], PLUGIN_GUID_DATADROPDOWN ); @@ -73,7 +74,7 @@ function data_dropdown_help() { */ function data_dropdown($data, $params) { extract ($params, EXTR_SKIP); - $title = isset($title) ? $title : KernelTools::tra( 'For More Information, click me.' ); + $title = $title ?? KernelTools::tra( 'For More Information, click me.' ); $id = 'dropdown'.(microtime() * 1000000); $ret = '
' .''.$title.'' diff --git a/plugins/data.example.php b/plugins/data.example.php index 7e86407..2b1adfc 100755 --- a/plugins/data.example.php +++ b/plugins/data.example.php @@ -1,6 +1,7 @@ KernelTools::tra("This Plugin is an Example that does nothing. It functions as a template for the creation of new plugins."), 'help_function' => '\data_example_help', 'syntax' => "{EXAM x1= x2= }", - 'plugin_type' => DATA_PLUGIN + 'plugin_type' => DATA_PLUGIN, ]; $gLibertySystem->registerPlugin( PLUGIN_GUID_DATAEXAMPLE, $pluginParams ); $gLibertySystem->registerDataTag( $pluginParams['tag'], PLUGIN_GUID_DATAEXAMPLE ); @@ -65,7 +66,7 @@ function data_example_help() { .'
' . KernelTools::tra( "The Default =") . ' 3 ' . KernelTools::tra( "Which means - What") .'' .'' - .'' + .'' . KernelTools::tra("Example: ") . "{EXAM x1=' ' x2=5 }
" . KernelTools::tra("This will display"); return $help; diff --git a/plugins/data.geshidata.php b/plugins/data.geshidata.php index a7ec24b..23ed18c 100755 --- a/plugins/data.geshidata.php +++ b/plugins/data.geshidata.php @@ -1,6 +1,7 @@ KernelTools::tra("This plugin is a documentation tool for the bitweaver site. It will display some of information defined in the GeSHi (Generic Syntax Highlighter) package."), 'help_function' => '\data_help_GeshiData', 'syntax' => "{GESHIDATA doall= lang= info= }", - 'plugin_type' => DATA_PLUGIN + 'plugin_type' => DATA_PLUGIN, ]; $gLibertySystem->registerPlugin( PLUGIN_GUID_DATAGESHIDATA, $pluginParams ); $gLibertySystem->registerDataTag( $pluginParams['tag'], PLUGIN_GUID_DATAGESHIDATA ); @@ -120,7 +121,7 @@ function data_GeshiData($data, $params) { return $ret; } } } return \pluginError('GeshiData', KernelTools::tra('The value placed in the parameter').' $info='.$info.' '.KernelTools::tra("was not a valid Key-word.")); - } else { + } $ret = '
'; $ret .= '
'; // The Header $ret .= ''.KernelTools::tra('Language Properties').''; @@ -161,6 +162,6 @@ function data_GeshiData($data, $params) { } // foreach $ret .= '
'; $ret .= '
'; - } + return $ret; } diff --git a/plugins/data.googleviewer.php b/plugins/data.googleviewer.php index 89261b3..b2442bf 100755 --- a/plugins/data.googleviewer.php +++ b/plugins/data.googleviewer.php @@ -1,6 +1,7 @@ KernelTools::tra( "This plugin allows you to simply embed a PDF document in a page using the embeddable Google Viewer." ), 'help_function' => '\data_googleviewer_help', 'syntax' => "{googleviewer url=}", - 'plugin_type' => DATA_PLUGIN + 'plugin_type' => DATA_PLUGIN, ]; $gLibertySystem->registerPlugin( PLUGIN_GUID_DATAGOOGLEVIEWER, $pluginParams ); $gLibertySystem->registerDataTag( $pluginParams['tag'], PLUGIN_GUID_DATAGOOGLEVIEWER ); @@ -78,7 +79,7 @@ function data_googleviewer( $pData, $pParams ) { if( !empty( $url )) { return ''; - } else { - return KernelTools::tra( 'No URL given' ); } + return KernelTools::tra( 'No URL given' ); + } diff --git a/plugins/data.graphviz.php b/plugins/data.graphviz.php index d4d679e..e9db497 100755 --- a/plugins/data.graphviz.php +++ b/plugins/data.graphviz.php @@ -1,6 +1,7 @@ KernelTools::tra("This plugin renders it's content as a graphviz image (dot or neato). It requies the Image_GraphViz pear plugin and graphviz to be installed: pear install Image_GraphViz"), 'help_function' => '\data_graphviz_help', 'syntax' => "{GRAPHVIZ}digraph ... {/GRAPHVIZ}", - 'plugin_type' => DATA_PLUGIN + 'plugin_type' => DATA_PLUGIN, ]; $gLibertySystem->registerPlugin( PLUGIN_GUID_DATAGRAPHVIZ, $pluginParams ); $gLibertySystem->registerDataTag( $pluginParams['tag'], PLUGIN_GUID_DATAGRAPHVIZ ); @@ -66,7 +67,7 @@ function data_graphviz_help() { .'
' . KernelTools::tra( "The Default =") . ' 3 ' . KernelTools::tra( "Which means - What") .'' .'' - .'' + .'' . KernelTools::tra("Example: ") . "{EXAM x1=' ' x2=5 }
" . KernelTools::tra("This will display"); return $help; @@ -80,24 +81,24 @@ function data_graphviz($data, $params) { $storageurl = STORAGE_PKG_URL.'GraphViz/'; $storagepath = STORAGE_PKG_PATH.'GraphViz/'; $temppath = TEMP_PKG_PATH.'GraphViz/'; - + if( !is_dir( $temppath ) ) { KernelTools::mkdir_p( $temppath ); } if( !is_dir( $storagepath ) ) { KernelTools::mkdir_p( $storagepath ); } - + $file = md5( $data ); $dotFile = $temppath . $file . '.dot'; $pngFile = $storagepath . $file . '.png'; $pngURL = $storageurl . $file . '.png'; - + if( !file_exists( $pngFile ) ) { if( @include_once 'PEAR.php' ) { if(@include_once UTIL_PKG_INCLUDE_PATH.'pear/Image/GraphViz.php' ) { $graph = new \Image_GraphViz; - $error = '
'.KernelTools::tra("Unable to write temporary file. Please check your server configuration.").'
'; + $error = '
'.KernelTools::tra("Unable to write temporary file. Please check your server configuration.").'
'; if (!$fp = fopen($dotFile, 'w')) { return $error; } @@ -108,7 +109,7 @@ function data_graphviz($data, $params) { $graph->renderDotFile( $dotFile, $pngFile, 'png' ); // No need to keep this lying around unlink($dotFile); - + // If it still isn't there.... if (!file_exists($pngFile)) { return '
'.KernelTools::tra("Unable to generate graphviz image file. Please check your data.").'
'; @@ -118,7 +119,7 @@ function data_graphviz($data, $params) { return "
".KernelTools::tra("The Image_Graphviz pear plugin is not installed. Install with `pear install Image_Graphviz`.")."
"; } } - else { + else { return "
".KernelTools::tra("PEAR and the Image_Graphviz pear plugin are not installed.")."
"; } } diff --git a/plugins/data.img.php b/plugins/data.img.php index d8ce09f..8e41af6 100755 --- a/plugins/data.img.php +++ b/plugins/data.img.php @@ -1,7 +1,6 @@ "{img src=http://www.google.at/logos/olympics06_ski_jump.gif}", 'plugin_type' => DATA_PLUGIN, 'booticon' => '{booticon iname="icon-picture" iexplain="Web Image"}', - 'taginsert' => '{img src= width= height= align= description= link=}' + 'taginsert' => '{img src= width= height= align= description= link=}', ]; $gLibertySystem->registerPlugin( PLUGIN_GUID_DATAIMG, $pluginParams ); $gLibertySystem->registerDataTag( $pluginParams['tag'], PLUGIN_GUID_DATAIMG ); diff --git a/plugins/data.include.php b/plugins/data.include.php index 1bbfc61..5d6e13d 100755 --- a/plugins/data.include.php +++ b/plugins/data.include.php @@ -1,8 +1,8 @@ KernelTools::tra("This plugin is used to include the contents of one Wiki page in another Wiki page."), 'help_function' => '\data_include_help', 'syntax' => "{INCLUDE content_id= }", - 'plugin_type' => DATA_PLUGIN + 'plugin_type' => DATA_PLUGIN, ]; $gLibertySystem->registerPlugin( PLUGIN_GUID_DATAINCLUDE, $pluginParams ); $gLibertySystem->registerDataTag( $pluginParams['tag'], PLUGIN_GUID_DATAINCLUDE ); diff --git a/plugins/data.jstabs.php b/plugins/data.jstabs.php index 50493d3..d3e9c15 100755 --- a/plugins/data.jstabs.php +++ b/plugins/data.jstabs.php @@ -1,8 +1,8 @@ registerPlugin( PLUGIN_GUID_DATAJSTABS, $pluginParams ); $gLibertySystem->registerDataTag( $pluginParams['tag'], PLUGIN_GUID_DATAJSTABS ); - function data_jstabs( $pData, $pParams, $pCommonObject ) { global $gBitSmarty; @@ -67,9 +66,9 @@ function data_jstabs( $pData, $pParams, $pCommonObject ) { if( !empty( $html )) { return \Bitweaver\Liberty\smarty_block_jstabs( [], $html, $gBitSmarty, '' ); - } else { - return ' '; } + return ' '; + } function data_jstabs_help() { diff --git a/plugins/data.ledgertable.php b/plugins/data.ledgertable.php index 16554cf..cb3ef06 100755 --- a/plugins/data.ledgertable.php +++ b/plugins/data.ledgertable.php @@ -1,6 +1,7 @@ KernelTools::tra("This Plugin creates a ledger-like table with even/odd row colors, optional top- or left-placed headers, and support for row/column spans."), 'help_function' => '\data_ledgertable_help', 'syntax' => "{LEDGERTABLE loc= head= }", - 'plugin_type' => DATA_PLUGIN + 'plugin_type' => DATA_PLUGIN, ]; $gLibertySystem->registerPlugin( PLUGIN_GUID_DATALEDGERTABLE, $pluginParams ); $gLibertySystem->registerDataTag( $pluginParams['tag'], PLUGIN_GUID_DATALEDGERTABLE ); @@ -60,14 +61,14 @@ function data_ledgertable_help() { .'' . KernelTools::tra("LedgerTable: ") . "{LEDGERTABLE loc=>left head=>Row1~|~Row2~|~Row3}
" . KernelTools::tra("This will display") - . data_ledgertable('Example', array('loc' => 'left', 'head' => 'Row1~|~Row2~|~Row3')); + . data_ledgertable('Example', ['loc' => 'left', 'head' => 'Row1~|~Row2~|~Row3']); return $help; } /**************** * Load Function * ****************/ function data_ledgertable($data, $params) { - global $gBitSystem; + global $gBitSystem; if (empty($data)) { return ""; @@ -77,76 +78,76 @@ function data_ledgertable($data, $params) { } $ret = ''; - if (isset($params['loc'])) { + if (isset($params['loc'])) { $ret .= ""; $plugdata_loc = $params['loc']; } else { $ret .= ""; - $plugdata_loc = 'top'; - } - if (isset($params['head'])) { + $plugdata_loc = 'top'; + } + if (isset($params['head'])) { $ret .= ""; $plugdata_head = $params['head']; - } else { + } else { $ret .= ""; - } - if (isset($params['width'])) { + } + if (isset($params['width'])) { $ret .= ""; $plugdata_width = " style=\"width: " . $params['width'] . '"'; - } else { + } else { $plugdata_width = ""; - } + } - $ret .= ""; + $ret .= "
"; - if (isset($plugdata_head)) { - $headers = explode('~|~', $plugdata_head); - if ($plugdata_loc == 'top') { - $ret .= " "; - $ret .= " "; - foreach ($headers as $hdr) { - $ret .= " "; + if (isset($plugdata_head)) { + $headers = explode('~|~', $plugdata_head); + if ($plugdata_loc == 'top') { + $ret .= " "; + $ret .= " "; + foreach ($headers as $hdr) { + $ret .= " "; } } - $lines = mb_split("\n", $data); - $line_count = 0; - foreach ($lines as $line) { - $line = trim($line); - if (strlen($line) <= 0) { - continue; - } - $line_count++; + $lines = mb_split("\n", $data); + $line_count = 0; + foreach ($lines as $line) { + $line = trim($line); + if (strlen($line) <= 0) { + continue; + } + $line_count++; - $ret .= " "; - $ret .= " "; - if (isset($plugdata_head) && ($plugdata_loc == "left")) { - $ret .= " "; - $ret .= "
$hdr"; - } - $ret .= "
$hdr"; + } + $ret .= "
"; + if (isset($plugdata_head) && ($plugdata_loc == "left")) { + $ret .= " "; + $ret .= " KernelTools::tra("Display a module block in content"), 'help_function' => '\datamodule_help', 'syntax' => "{module module= align='right'}", - 'plugin_type' => DATA_PLUGIN + 'plugin_type' => DATA_PLUGIN, ]; $gLibertySystem->registerPlugin( PLUGIN_GUID_DATAMODULE, $pluginParams ); $gLibertySystem->registerDataTag( $pluginParams['tag'], PLUGIN_GUID_DATAMODULE ); @@ -115,7 +116,7 @@ function data_datamodule( $pData, $pParams ) { // deal with custom styling $style = ''; - $style_options = array( 'float', 'width', 'background', 'color' ); + $style_options = [ 'float', 'width', 'background', 'color' ]; foreach( $pParams as $param => $value ) { if( in_array( $param, $style_options ) ) { $style .= $param.':'.$value.';'; diff --git a/plugins/data.object.php b/plugins/data.object.php index 642314a..840bc0c 100755 --- a/plugins/data.object.php +++ b/plugins/data.object.php @@ -1,6 +1,7 @@ KernelTools::tra("This plugin displays a Flash, Tcl or Java applet/object."), 'help_function' => '\data_object_help', 'syntax' => "{OBJECT type= src= width= height=}", - 'plugin_type' => DATA_PLUGIN + 'plugin_type' => DATA_PLUGIN, ]; $gLibertySystem->registerPlugin( PLUGIN_GUID_DATAOBJECT, $pluginParams ); $gLibertySystem->registerDataTag( $pluginParams['tag'], PLUGIN_GUID_DATAOBJECT ); - function data_object_help() { $help = '' @@ -150,10 +150,9 @@ function data_object_help() { return $help; } - function data_object ($data, $params) { // Need these plugin parameters - foreach (array("type", "src") as $parameter) { + foreach (["type", "src"] as $parameter) { if (!array_key_exists($parameter, $params)) return ''.KernelTools::tra('When using {object}, a type and src parameter is required.').''; } diff --git a/plugins/data.pluginhelp.php b/plugins/data.pluginhelp.php index c5f914a..043d335 100755 --- a/plugins/data.pluginhelp.php +++ b/plugins/data.pluginhelp.php @@ -1,6 +1,7 @@ KernelTools::tra("This plugin will display the plugin's Help."), 'help_function' => '\data_pluginhelp_help', 'syntax' => "{PLUGINHELP plugin= }", - 'plugin_type' => DATA_PLUGIN + 'plugin_type' => DATA_PLUGIN, ]; $gLibertySystem->registerPlugin( PLUGIN_GUID_DATAPLUGINHELP, $pluginParams ); $gLibertySystem->registerDataTag( $pluginParams['tag'], PLUGIN_GUID_DATAPLUGINHELP ); diff --git a/plugins/data.pre.php b/plugins/data.pre.php index 9bb42d0..c822713 100755 --- a/plugins/data.pre.php +++ b/plugins/data.pre.php @@ -1,8 +1,8 @@ KernelTools::tra( "This plugin allows you to easily create a preformatted text block with a number of optional CSS parameters." ), 'help_function' => '\data_pre_help', 'syntax' => "{pre border='3px solid blue'}", - 'plugin_type' => DATA_PLUGIN + 'plugin_type' => DATA_PLUGIN, ]; $gLibertySystem->registerPlugin( PLUGIN_GUID_DATAPRE, $pluginParams ); $gLibertySystem->registerDataTag( $pluginParams['tag'], PLUGIN_GUID_DATAPRE ); diff --git a/plugins/data.quote.php b/plugins/data.quote.php index 67e927d..a05d4e2 100755 --- a/plugins/data.quote.php +++ b/plugins/data.quote.php @@ -1,9 +1,9 @@ 'DataPluginQuote', 'description' => KernelTools::tra( "This plugin allows content to be attributed to other authors and visually indicated." ), 'syntax' => "{quote format_guid= user= comment_id= }.. content ..{/quote}", - 'plugin_type' => DATA_PLUGIN + 'plugin_type' => DATA_PLUGIN, ]; $gLibertySystem->registerPlugin( PLUGIN_GUID_DATAQUOTE, $pluginParams ); $gLibertySystem->registerDataTag( $pluginParams['tag'], PLUGIN_GUID_DATAQUOTE ); @@ -100,7 +100,7 @@ function data_quote( $pData, $pParams ) { $user = empty( $pParams['user'] ) ? null : $pParams['user']; if( !empty( $pParams['comment_id'] )) { - + $c = $gBitSystem->getActivePackage() == 'boards' ? new BitBoardPost( preg_replace( '/[^0-9]/', '', $pParams['comment_id'] ) ) : new LibertyComment( preg_replace( '/[^0-9]/', '', $pParams['comment_id'] ) ); diff --git a/plugins/data.renderer.php b/plugins/data.renderer.php index 3966a66..9a07095 100755 --- a/plugins/data.renderer.php +++ b/plugins/data.renderer.php @@ -1,6 +1,7 @@ 'DataPluginRenderer', 'description' => KernelTools::tra( "This plugin will render the given content as described by the content_type given." ), 'syntax' => "{renderer class= format_guid= }.. content ..{/renderer}", - 'plugin_type' => DATA_PLUGIN + 'plugin_type' => DATA_PLUGIN, ]; $gLibertySystem->registerPlugin( PLUGIN_GUID_DATARENDERER, $pluginParams ); $gLibertySystem->registerDataTag( $pluginParams['tag'], PLUGIN_GUID_DATARENDERER ); diff --git a/plugins/data.sort.php b/plugins/data.sort.php index 0e228a2..998b177 100755 --- a/plugins/data.sort.php +++ b/plugins/data.sort.php @@ -1,8 +1,8 @@ KernelTools::tra( "This plugin will sort the lines within a {sort} block." ), 'help_function' => '\data_sort_help', 'syntax' => "{sort sort= }".KernelTools::tra( "Lines to be sorted" )."{sort}", - 'plugin_type' => DATA_PLUGIN + 'plugin_type' => DATA_PLUGIN, ]; $gLibertySystem->registerPlugin( PLUGIN_GUID_DATASORT, $pluginParams ); $gLibertySystem->registerDataTag( $pluginParams['tag'], PLUGIN_GUID_DATASORT ); diff --git a/plugins/data.span.php b/plugins/data.span.php index a16a89f..e7a0df9 100755 --- a/plugins/data.span.php +++ b/plugins/data.span.php @@ -1,8 +1,8 @@ KernelTools::tra( "This plugin allows you to easily create a span with a number of optional CSS parameters." ), 'help_function' => '\data_span_help', 'syntax' => "{span border='3px solid blue'}", - 'plugin_type' => DATA_PLUGIN + 'plugin_type' => DATA_PLUGIN, ]; $gLibertySystem->registerPlugin( PLUGIN_GUID_DATAspan, $pluginParams ); $gLibertySystem->registerDataTag( $pluginParams['tag'], PLUGIN_GUID_DATAspan ); diff --git a/plugins/data.textarea.php b/plugins/data.textarea.php index a0890ac..107e28a 100755 --- a/plugins/data.textarea.php +++ b/plugins/data.textarea.php @@ -1,8 +1,8 @@ KernelTools::tra( "This plugin allows you to easily create a textarea with a number of optional CSS parameters." ), 'help_function' => '\data_textarea_help', 'syntax' => "{textarea}", - 'plugin_type' => DATA_PLUGIN + 'plugin_type' => DATA_PLUGIN, ]; $gLibertySystem->registerPlugin( PLUGIN_GUID_DATAtextarea, $pluginParams ); $gLibertySystem->registerDataTag( $pluginParams['tag'], PLUGIN_GUID_DATAtextarea ); diff --git a/plugins/data.toc.php b/plugins/data.toc.php index c40a97d..5428587 100755 --- a/plugins/data.toc.php +++ b/plugins/data.toc.php @@ -1,9 +1,9 @@ DATA_PLUGIN, 'booticon' => '{booticon iname="icon-list-ol" iexplain="Structure Table of Contents"}', 'taginsert' => '{toc}', - 'structure_id' => 'id of the structure to display' + 'structure_id' => 'id of the structure to display', ]; $gLibertySystem->registerPlugin( PLUGIN_GUID_DATATOC, $pluginParams ); $gLibertySystem->registerDataTag( $pluginParams['tag'], PLUGIN_GUID_DATATOC ); diff --git a/plugins/data.video.php b/plugins/data.video.php index 933886b..5d59520 100755 --- a/plugins/data.video.php +++ b/plugins/data.video.php @@ -1,6 +1,7 @@ KernelTools::tra( "This plugin allows you to simply and safely insert a video in a page. Currently it only supports Flash Video (.flv) files." ), 'help_function' => '\data_video_help', 'syntax' => "{video video= player=}", - 'plugin_type' => DATA_PLUGIN + 'plugin_type' => DATA_PLUGIN, ]; $gLibertySystem->registerPlugin( PLUGIN_GUID_DATAVIDEO, $pluginParams ); $gLibertySystem->registerDataTag( $pluginParams['tag'], PLUGIN_GUID_DATAVIDEO ); diff --git a/plugins/data.youtube.php b/plugins/data.youtube.php index ddefc43..cd944b5 100755 --- a/plugins/data.youtube.php +++ b/plugins/data.youtube.php @@ -1,6 +1,7 @@ 'YOUTUBE', 'auto_activate' => false, 'requires_pair' => false, @@ -25,8 +26,8 @@ $pluginParams = array ( 'description' => KernelTools::tra( "This plugin allows you to simply and safely insert a YouTube video in a page." ), 'help_function' => '\data_youtube_help', 'syntax' => "{youtube id=}", - 'plugin_type' => DATA_PLUGIN -); + 'plugin_type' => DATA_PLUGIN, +]; $gLibertySystem->registerPlugin( PLUGIN_GUID_DATAYOUTUBE, $pluginParams ); $gLibertySystem->registerDataTag( $pluginParams['tag'], PLUGIN_GUID_DATAYOUTUBE ); @@ -90,7 +91,7 @@ function data_youtube( $pData, $pParams ) { if( !empty( $id )) { return ''; - } else { - return KernelTools::tra( 'No ID given' ); } + return KernelTools::tra( 'No ID given' ); + } diff --git a/plugins/filter.attachment.php b/plugins/filter.attachment.php index a6b128e..2aa0b4c 100755 --- a/plugins/filter.attachment.php +++ b/plugins/filter.attachment.php @@ -1,5 +1,6 @@ [ 'lib_att_usage_content_idx' => [ 'table' => 'liberty_attachment_usage', 'cols' => 'content_id', 'opts' => null ], diff --git a/plugins/filter.backtotop.php b/plugins/filter.backtotop.php index 637a44c..f58f8aa 100755 --- a/plugins/filter.backtotop.php +++ b/plugins/filter.backtotop.php @@ -6,8 +6,9 @@ */ namespace Bitweaver\Liberty; + use Bitweaver\KernelTools; - + /** * definitions ( guid character limit is 16 chars ) */ @@ -42,11 +43,11 @@ function backtotop_postparsefilter( &$pData, &$pFilterHash ) { $params['max'] = 6; $params = array_merge( $params, KernelTools::parse_xml_attributes( $backtotop[1] )); - $biticon = array( + $biticon = [ 'ipackage' => 'icons', 'iname' => 'go-top', 'iexplain' => 'Back to top', - ); + ]; // get all headers into an array preg_match_all( "/]*)>.*?<\/h\d>/i", $pData, $headers ); diff --git a/plugins/filter.bitlinks.php b/plugins/filter.bitlinks.php index f448af9..593453b 100755 --- a/plugins/filter.bitlinks.php +++ b/plugins/filter.bitlinks.php @@ -1,9 +1,9 @@ expungeLinks( $pObject->mContentId ); } - - - - /** * BitLinks class * @@ -312,8 +307,8 @@ class BitLinks extends BitBase { } } - // Process ((Wiki Page|Wiki Page Description)) type links first. Here - // we don't handle plurals and the like since the user should know what + // Process ((Wiki Page|Wiki Page Description)) type links first. Here + // we don't handle plurals and the like since the user should know what // he's linking to when using these links preg_match_all( "@\({2}({$this->mWikiWordRegex})\|(.+?)\){2}@", $pData, $pages ); for( $i = 0; $i < count( $pages[1] ); $i++ ) { @@ -588,7 +583,6 @@ class BitLinks extends BitBase { // - replace with new name leaving description in tact $replace[] = "(($pNewName|$1))"; - // --- ((Wiki Page)) or WikiPage // (\([2])? # check for (( - optional - put this in $1 // \b$pOldName\b # make sure the old name is on it's own diff --git a/plugins/filter.htmlpurifier.php b/plugins/filter.htmlpurifier.php index bfbfaa6..abed4e1 100755 --- a/plugins/filter.htmlpurifier.php +++ b/plugins/filter.htmlpurifier.php @@ -6,8 +6,7 @@ */ namespace Bitweaver\Liberty; - use Bitweaver\KernelTools; - + /** * definitions ( guid character limit is 16 chars ) */ @@ -15,7 +14,7 @@ define( 'PLUGIN_GUID_FILTERHTMLPURIFIER', 'filterhtmlpure' ); global $gLibertySystem; -$pluginParams = array ( +$pluginParams = [ // plugin title 'title' => 'HTMLPurifier', // help page on bitweaver org that explains this plugin @@ -38,7 +37,7 @@ $pluginParams = array ( // 'presplit_function' => '\Bitweaver\Liberty\htmlpure_filter', // called after the data has been parsed if there is a split 'postsplit_function' => '\Bitweaver\Liberty\htmlpure_filter', -); +]; $gLibertySystem->registerPlugin( PLUGIN_GUID_FILTERHTMLPURIFIER, $pluginParams ); function htmlpure_filter( &$pString, &$pFilterHash, $pObject ) { @@ -47,7 +46,7 @@ function htmlpure_filter( &$pString, &$pFilterHash, $pObject ) { if (!isset($gHtmlPurifier)) { $pear_version = false; - if (@include_once "PEAR.php") { + if (@include_once "PEAR.php") { if(@include_once UTIL_PKG_INCLUDE_PATH."/htmlpurifier-4.15.0/library/HTMLPurifier.php") { // for backward compatibility checks $htmlp_version = null; @@ -61,11 +60,10 @@ function htmlpure_filter( &$pString, &$pFilterHash, $pObject ) { $config = htmlpure_getDefaultConfig( $htmlp_version, $pObject ); - // As suggested here: https://www.bitweaver.org/forums/index.php?t=8554 $gHtmlPurifier = new \HTMLPurifier($config); - // how plugins are registered changed in v3.1 + // how plugins are registered changed in v3.1 // old way of adding plugins before v3.1 if ( !$htmlp_version >= 3.1 ) { htmlpure_legacyAddFilters(); @@ -75,7 +73,7 @@ function htmlpure_filter( &$pString, &$pFilterHash, $pObject ) { } // Did we manage to create one? - if (isset($gHtmlPurifier)) { + if (isset($gHtmlPurifier)) { /* Clean up the paragraphs a bit */ // $start = $pData; $pString = htmlpure_cleanupPeeTags($pString); @@ -103,8 +101,8 @@ function htmlpure_filter( &$pString, &$pFilterHash, $pObject ) { // If we have another parse step they may be escaping // entities so change quotes back. - if (empty($pFilterHash['format_guid']) || - $pFilterHash['format_guid'] != 'bithtml') { + if (empty($pFilterHash['format_guid']) || + $pFilterHash['format_guid'] != 'bithtml') { $pString = preg_replace('|"|', '"', $pString); $pString = preg_replace('|'|', "'", $pString); } @@ -140,7 +138,6 @@ function htmlpure_getDefaultConfig( &$htmlp_version, $pObject=null ){ //$config->set('HTML.DefinitionRev', 1); //$config->set('Cache.DefinitionImpl', null); // remove this later! - // Set the cache path $config->set('Cache.SerializerPath', rtrim( TEMP_PKG_PATH, '/' ) ); @@ -171,7 +168,7 @@ function htmlpure_getDefaultConfig( &$htmlp_version, $pObject=null ){ INNER JOIN `".BIT_DB_PREFIX."users_group_permissions` ugp ON (ugp.`group_id`=ugm.`group_id`) WHERE ugm.`user_id`=? AND (ugp.`perm_name`=? OR ugp.`perm_name`='p_admin')"; // cache for 15 minutes - $hasAdmin = $pObject->mDb->getOne( $query, array( $pObject->getField( 'modifier_user_id' ), $pObject->mAdminContentPerm ), null, null, 900 ); + $hasAdmin = $pObject->mDb->getOne( $query, [ $pObject->getField( 'modifier_user_id' ), $pObject->mAdminContentPerm ], null, null, 900 ); } if( $hasAdmin ) { @@ -179,11 +176,11 @@ function htmlpure_getDefaultConfig( &$htmlp_version, $pObject=null ){ $config->set( 'CSS.AllowTricky', true ); $css = $config->getCSSDefinition(); - $css->info['position'] = new \HTMLPurifier_AttrDef_CSS_Composite([ new \HTMLPurifier_AttrDef_Enum(['absolute', 'fixed', 'relative', 'static', 'inherit'] ) ] ); - $css->info['top'] = new \HTMLPurifier_AttrDef_CSS_Composite([ new \HTMLPurifier_AttrDef_CSS_Length() ] ); - $css->info['left'] = new \HTMLPurifier_AttrDef_CSS_Composite([ new \HTMLPurifier_AttrDef_CSS_Length() ] ); - $css->info['bottom'] = new \HTMLPurifier_AttrDef_CSS_Composite([ new \HTMLPurifier_AttrDef_CSS_Length() ] ); - $css->info['right'] = new \HTMLPurifier_AttrDef_CSS_Composite([ new \HTMLPurifier_AttrDef_CSS_Length() ] ); + $css->info['position'] = new \HTMLPurifier_AttrDef_CSS_Composite([ new \HTMLPurifier_AttrDef_Enum(['absolute', 'fixed', 'relative', 'static', 'inherit'] ) ] ); + $css->info['top'] = new \HTMLPurifier_AttrDef_CSS_Composite([ new \HTMLPurifier_AttrDef_CSS_Length() ] ); + $css->info['left'] = new \HTMLPurifier_AttrDef_CSS_Composite([ new \HTMLPurifier_AttrDef_CSS_Length() ] ); + $css->info['bottom'] = new \HTMLPurifier_AttrDef_CSS_Composite([ new \HTMLPurifier_AttrDef_CSS_Length() ] ); + $css->info['right'] = new \HTMLPurifier_AttrDef_CSS_Composite([ new \HTMLPurifier_AttrDef_CSS_Length() ] ); //$def =& $config->getHTMLDefinition(); //$def->addAttribute('a', 'target', 'Enum#_blank,_self,_target,_top'); } else { @@ -277,7 +274,7 @@ function htmlpure_legacyAddFilters(){ function htmlpure_cleanupPeeTags( $pee ) { // Convert us some form feeds for better cross platform support - $pee = str_replace(array("\r\n", "\r"), "\n", $pee); + $pee = str_replace(["\r\n", "\r"], "\n", $pee); // Strip out lots of duplicate newlines now $pee = preg_replace("#\n\n+#", "\n\n", $pee); @@ -292,7 +289,7 @@ function htmlpure_cleanupPeeTags( $pee ) { $pee = preg_replace('#(]*)>)(.*?)#si', " '$1' . preg_replace('#]*)/>#', '"."\n"."', preg_replace('#]*)>#', '"."\n"."', - preg_replace('#]*)>#', '', '$2'))). ''", $pee); + preg_replace('#]*)>#', '', '$2'))). ''", $pee, ); // Fixup align divs so we can keep them. $pee = preg_replace('##', '', $pee); diff --git a/plugins/filter.maketoc.php b/plugins/filter.maketoc.php index 7daa56e..04b3467 100755 --- a/plugins/filter.maketoc.php +++ b/plugins/filter.maketoc.php @@ -1,5 +1,6 @@ ]*>(.*?)<\/h\d>/i", $pData, $headers ); - // clumsy way of finding out if index is set. since we can't allow - // duplicate settings of index in one page, we either index everything + // clumsy way of finding out if index is set. since we can't allow + // duplicate settings of index in one page, we either index everything // or nothing. foreach( $params as $p ) { if( empty( $index )) { @@ -125,7 +126,7 @@ function maketoc_postparsefilter( &$pData, &$pFilterHash ) { } } - $pData = isset( $ret ) ? $ret : preg_replace( "/\{maketoc[^\}]*\}\s*(]*>)*/i", "", $pData ); + $pData = $ret ?? preg_replace( "/\{maketoc[^\}]*\}\s*(]*>)*/i", "", $pData ); } function maketoc_create_list( $pTocHash, $pParams ) { diff --git a/plugins/filter.simplepurifier.php b/plugins/filter.simplepurifier.php index ba829b3..313a956 100755 --- a/plugins/filter.simplepurifier.php +++ b/plugins/filter.simplepurifier.php @@ -17,7 +17,7 @@ global $gLibertySystem; // Set of default acceptable HTML tags define( 'DEFAULT_ACCEPTABLE_TAGS', '


' .'
    • ' - .'