From 83a18e46025e9b45705fa41909a6f85c34ee14eb Mon Sep 17 00:00:00 2001 From: Lester Caine Date: Thu, 14 May 2026 09:52:56 +0100 Subject: php-cs-fixer tidies to php8.5 standards Co-Authored-By: Claude Sonnet 4.6 --- admin/admin_rssmodules.php | 8 +-- admin/index.php | 2 +- admin/schema_inc.php | 5 +- icons/pkg_rss.gif | Bin icons/pkg_rss.png | Bin icons/rss-10x10.gif | Bin icons/rss-10x10.png | Bin icons/rss-128x128.gif | Bin icons/rss-128x128.png | Bin icons/rss-12x12.gif | Bin icons/rss-12x12.png | Bin icons/rss-16x16.gif | Bin icons/rss-16x16.png | Bin icons/rss-24x24.gif | Bin icons/rss-24x24.png | Bin icons/rss-32x32.gif | Bin icons/rss-32x32.png | Bin icons/rss-48x48.gif | Bin icons/rss-48x48.png | Bin icons/rss-64x64.gif | Bin icons/rss-64x64.png | Bin icons/rss-96x96.gif | Bin icons/rss-96x96.png | Bin includes/classes/FeedCreator.php | 37 +++-------- includes/classes/FeedHtmlField.php | 8 +-- includes/classes/FeedItem.php | 1 - includes/classes/RSSLib.php | 107 +++++++++++++++--------------- includes/classes/UniversalFeedCreator.php | 33 ++++----- includes/rss_inc.php | 1 - liberty_plugins/data.rss.php | 12 ++-- modules/help_mod_rss_feed.tpl | 0 modules/mod_rss_feed.php | 13 ++-- modules/mod_rss_feed.tpl | 0 templates/admin_rss.tpl | 0 templates/admin_rssmodules.tpl | 0 templates/index.php | 2 +- templates/menu_rss_admin.tpl | 0 templates/rss.tpl | 0 38 files changed, 100 insertions(+), 129 deletions(-) mode change 100644 => 100755 icons/pkg_rss.gif mode change 100644 => 100755 icons/pkg_rss.png mode change 100644 => 100755 icons/rss-10x10.gif mode change 100644 => 100755 icons/rss-10x10.png mode change 100644 => 100755 icons/rss-128x128.gif mode change 100644 => 100755 icons/rss-128x128.png mode change 100644 => 100755 icons/rss-12x12.gif mode change 100644 => 100755 icons/rss-12x12.png mode change 100644 => 100755 icons/rss-16x16.gif mode change 100644 => 100755 icons/rss-16x16.png mode change 100644 => 100755 icons/rss-24x24.gif mode change 100644 => 100755 icons/rss-24x24.png mode change 100644 => 100755 icons/rss-32x32.gif mode change 100644 => 100755 icons/rss-32x32.png mode change 100644 => 100755 icons/rss-48x48.gif mode change 100644 => 100755 icons/rss-48x48.png mode change 100644 => 100755 icons/rss-64x64.gif mode change 100644 => 100755 icons/rss-64x64.png mode change 100644 => 100755 icons/rss-96x96.gif mode change 100644 => 100755 icons/rss-96x96.png mode change 100644 => 100755 modules/help_mod_rss_feed.tpl mode change 100644 => 100755 modules/mod_rss_feed.tpl mode change 100644 => 100755 templates/admin_rss.tpl mode change 100644 => 100755 templates/admin_rssmodules.tpl mode change 100644 => 100755 templates/menu_rss_admin.tpl mode change 100644 => 100755 templates/rss.tpl diff --git a/admin/admin_rssmodules.php b/admin/admin_rssmodules.php index aa24360..aa32877 100644 --- a/admin/admin_rssmodules.php +++ b/admin/admin_rssmodules.php @@ -42,7 +42,7 @@ if( isset( $_REQUEST["view"] ) ) { if( $_REQUEST["rss_id"] ) { $info = $rsslib->get_rss_module( $_REQUEST["rss_id"] ); } else { - $info = array(); + $info = []; $info["name"] = ''; $info["description"] = ''; @@ -60,12 +60,11 @@ $gBitSmarty->assign('show_title', $info["show_title"]); $gBitSmarty->assign('show_pub_date', $info["show_pub_date"]); if (isset($_REQUEST["remove"])) { - + $rsslib->remove_rss_module($_REQUEST["remove"]); } if (isset($_REQUEST["save"])) { - if (isset($_REQUEST['show_title']) == 'on') { $gBitSmarty->assign('show_title', 'y'); @@ -132,7 +131,6 @@ if ($offset > 0) { $gBitSmarty->assign('channels', $channels["data"]); - // Display the template -$gBitSystem->display( 'bitpackage:rss/admin_rssmodules.tpl', NULL, array( 'display_mode' => 'admin' )); +$gBitSystem->display( 'bitpackage:rss/admin_rssmodules.tpl', NULL, [ 'display_mode' => 'admin' ]); diff --git a/admin/index.php b/admin/index.php index 1e6de35..30a5490 100644 --- a/admin/index.php +++ b/admin/index.php @@ -1,4 +1,4 @@ -registerSchemaTable( RSS_PKG_NAME, $tableName, $tables[$tableName] ); } -$gBitInstaller->registerPackageInfo( RSS_PKG_NAME, array( +$gBitInstaller->registerPackageInfo( RSS_PKG_NAME, [ 'description' => "Resource Description Framework (RDF) Site Summary (RSS) is a lightweight multipurpose extensible metadata description and syndication format. It allows users to read healines from your site with a dedicated RSS reader.", 'license' => 'LGPL', -) ); +] ); // ### Default Preferences $gBitInstaller->registerPreferences( RSS_PKG_NAME, [ diff --git a/icons/pkg_rss.gif b/icons/pkg_rss.gif old mode 100644 new mode 100755 diff --git a/icons/pkg_rss.png b/icons/pkg_rss.png old mode 100644 new mode 100755 diff --git a/icons/rss-10x10.gif b/icons/rss-10x10.gif old mode 100644 new mode 100755 diff --git a/icons/rss-10x10.png b/icons/rss-10x10.png old mode 100644 new mode 100755 diff --git a/icons/rss-128x128.gif b/icons/rss-128x128.gif old mode 100644 new mode 100755 diff --git a/icons/rss-128x128.png b/icons/rss-128x128.png old mode 100644 new mode 100755 diff --git a/icons/rss-12x12.gif b/icons/rss-12x12.gif old mode 100644 new mode 100755 diff --git a/icons/rss-12x12.png b/icons/rss-12x12.png old mode 100644 new mode 100755 diff --git a/icons/rss-16x16.gif b/icons/rss-16x16.gif old mode 100644 new mode 100755 diff --git a/icons/rss-16x16.png b/icons/rss-16x16.png old mode 100644 new mode 100755 diff --git a/icons/rss-24x24.gif b/icons/rss-24x24.gif old mode 100644 new mode 100755 diff --git a/icons/rss-24x24.png b/icons/rss-24x24.png old mode 100644 new mode 100755 diff --git a/icons/rss-32x32.gif b/icons/rss-32x32.gif old mode 100644 new mode 100755 diff --git a/icons/rss-32x32.png b/icons/rss-32x32.png old mode 100644 new mode 100755 diff --git a/icons/rss-48x48.gif b/icons/rss-48x48.gif old mode 100644 new mode 100755 diff --git a/icons/rss-48x48.png b/icons/rss-48x48.png old mode 100644 new mode 100755 diff --git a/icons/rss-64x64.gif b/icons/rss-64x64.gif old mode 100644 new mode 100755 diff --git a/icons/rss-64x64.png b/icons/rss-64x64.png old mode 100644 new mode 100755 diff --git a/icons/rss-96x96.gif b/icons/rss-96x96.gif old mode 100644 new mode 100755 diff --git a/icons/rss-96x96.png b/icons/rss-96x96.png old mode 100644 new mode 100755 diff --git a/includes/classes/FeedCreator.php b/includes/classes/FeedCreator.php index 2c071b5..a78bf6e 100755 --- a/includes/classes/FeedCreator.php +++ b/includes/classes/FeedCreator.php @@ -138,7 +138,6 @@ class FeedCreator extends HtmlDescribable { */ public $title, $description, $link; - /** * Optional attributes of a feed. */ @@ -156,13 +155,11 @@ class FeedCreator extends HtmlDescribable { */ public $cssStyleSheet = ''; - /** * @access private */ public $items = []; - /** * This feed's MIME content type. * @since 1.4 @@ -170,7 +167,6 @@ class FeedCreator extends HtmlDescribable { */ public $contentType = "application/xml"; - /** * This feed's character encoding. * @since 1.6.1 @@ -186,7 +182,6 @@ class FeedCreator extends HtmlDescribable { public $generator = "support@rdmcloud.uk"; - /** * Any additional elements to include as an assiciated array. All $key => $value pairs * will be included unencoded in the feed in the form @@ -197,7 +192,6 @@ class FeedCreator extends HtmlDescribable { */ public $additionalElements = []; - /** * Adds an FeedItem to the feed. * @@ -215,7 +209,7 @@ class FeedCreator extends HtmlDescribable { **/ function version() { - return FEEDCREATOR_VERSION." (".$this->generator.")"; + return FEEDCREATOR_VERSION." (".$this->generator.")"; } /** @@ -257,7 +251,6 @@ class FeedCreator extends HtmlDescribable { } - /** * Creates a comment indicating the generator of this feed. * The format of this comment seems to be recognized by @@ -647,7 +640,7 @@ class RSSCreator091 extends FeedCreator { $feed .= " \n"; } // itunes expects an explicit setting. we default to no because we're not into this facist crap, but if you need to set it to yes you can. - $itunesExplicit = isset( $this->itunes['explicit'] ) ? $this->itunes['explicit'] : "no"; + $itunesExplicit = $this->itunes['explicit'] ?? "no"; $feed .= " " . $itunesExplicit . "\n"; } @@ -665,7 +658,7 @@ class RSSCreator091 extends FeedCreator { if ($this->items[$i]->authorEmail!="") { $feed.= " " . htmlspecialchars($this->items[$i]->authorEmail) . " (".htmlspecialchars($this->items[$i]->author).")\n"; } else { - $feed.= " no_email@example.com (".htmlspecialchars($this->items[$i]->author).")\n"; + $feed.= " no_email@example.com (".htmlspecialchars($this->items[$i]->author).")\n"; } } /* @@ -691,7 +684,6 @@ class RSSCreator091 extends FeedCreator { $feed .= " " . htmlspecialchars( $itemDate->rfc822() ) . "\n"; } - if ($this->items[$i]->guid!="") { $feed.= " ".htmlspecialchars($this->items[$i]->guid)."\n"; } else { @@ -712,9 +704,7 @@ class RSSCreator091 extends FeedCreator { $feed.= "\" type=\""; $feed.= $this->items[$i]->enclosure->type; $feed.= "\"/>\n"; - } - - + } $feed.= " \n"; } @@ -735,9 +725,9 @@ class RSSCreator091 extends FeedCreator { */ class RSSCreator20 extends RSSCreator091 { - function RSSCreator20() { - parent::_setRSSVersion("2.0"); - } + function RSSCreator20() { + parent::_setRSSVersion("2.0"); + } } @@ -840,7 +830,6 @@ class PIECreator01 extends FeedCreator { } if ($this->category!="") { - $feed.= " category) . "\" />\n"; } if ($this->copyright!="") { @@ -848,7 +837,6 @@ class PIECreator01 extends FeedCreator { } $feed.= " ".$this->version()."\n"; - $feed.= " syndicationURL). "\" />\n"; $feed.= $this->_createAdditionalElements($this->additionalElements, " "); for ($i=0;$iitems);$i++) { @@ -862,7 +850,6 @@ class PIECreator01 extends FeedCreator { $feed.= " ".htmlspecialchars($itemDate->iso8601())."\n"; $feed.= " ".htmlspecialchars($itemDate->iso8601())."\n"; - $tempguid = $this->items[$i]->link; if ($this->items[$i]->guid!="") { $tempguid = $this->items[$i]->guid; @@ -896,13 +883,11 @@ class PIECreator01 extends FeedCreator { if ($this->items[$i]->description!="") { - /* * ATOM should have at least summary tag, however this implementation may be inaccurate */ - $tempdesc = $this->items[$i]->getDescription(); - $temptype=""; - + $tempdesc = $this->items[$i]->getDescription(); + $temptype=""; if ($this->items[$i]->descriptionHtmlSyndicated){ $temptype=" type=\"html\""; @@ -914,7 +899,6 @@ class PIECreator01 extends FeedCreator { $feed.= " ". $tempdesc ."\n"; } - $feed.= " ". $tempdesc ."\n"; } else { @@ -935,8 +919,6 @@ class PIECreator01 extends FeedCreator { $feed .=" /> \n"; - - } $feed.= " \n"; } @@ -944,7 +926,6 @@ class PIECreator01 extends FeedCreator { return $feed; } - } /** diff --git a/includes/classes/FeedHtmlField.php b/includes/classes/FeedHtmlField.php index a5b37cb..bc1ec46 100755 --- a/includes/classes/FeedHtmlField.php +++ b/includes/classes/FeedHtmlField.php @@ -59,12 +59,12 @@ class FeedHtmlField { // Remove Bootstrap wrapper divs $html = preg_replace( '/]*class="(container|row|col-[^"]*)"[^>]*>/', '', $html ); $html = preg_replace( '/<\/div>/', '', $html ); - + // Keep formatting, images, links; strip everything else return preg_replace( - '/\s+/', - ' ', - strip_tags( $html, '