summaryrefslogtreecommitdiff
path: root/modules/rss
diff options
context:
space:
mode:
Diffstat (limited to 'modules/rss')
-rw-r--r--modules/rss/controllers/rss.php5
-rw-r--r--modules/rss/helpers/rss_installer.php24
-rw-r--r--modules/rss/module.info2
-rw-r--r--modules/rss/views/feed.mrss.php14
-rw-r--r--modules/rss/views/rss_block.html.php2
5 files changed, 13 insertions, 34 deletions
diff --git a/modules/rss/controllers/rss.php b/modules/rss/controllers/rss.php
index e9dd9fff..b89bed40 100644
--- a/modules/rss/controllers/rss.php
+++ b/modules/rss/controllers/rss.php
@@ -26,13 +26,16 @@ class Rss_Controller extends Controller {
url::redirect(url::merge(array("page" => 1)));
}
+ // Configurable page size between 1 and 100, default 20
+ $page_size = max(1, min(100, $this->input->get("page_size", self::$page_size)));
+
// Run the appropriate feed callback
if (module::is_active($module_id)) {
$class_name = "{$module_id}_rss";
if (method_exists($class_name, "feed")) {
$feed = call_user_func(
array($class_name, "feed"), $feed_id,
- ($page - 1) * self::$page_size, self::$page_size, $id);
+ ($page - 1) * $page_size, $page_size, $id);
}
}
if (empty($feed)) {
diff --git a/modules/rss/helpers/rss_installer.php b/modules/rss/helpers/rss_installer.php
deleted file mode 100644
index 7766fdfa..00000000
--- a/modules/rss/helpers/rss_installer.php
+++ /dev/null
@@ -1,24 +0,0 @@
-<?php defined("SYSPATH") or die("No direct script access.");
-/**
- * Gallery - a web based photo album viewer and editor
- * Copyright (C) 2000-2009 Bharat Mediratta
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or (at
- * your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
- */
-class rss_installer {
- static function install() {
- module::set_version("rss", 1);
- }
-}
diff --git a/modules/rss/module.info b/modules/rss/module.info
index 81ee7848..48375da1 100644
--- a/modules/rss/module.info
+++ b/modules/rss/module.info
@@ -1,3 +1,3 @@
name = "RSS"
-description = "Provide a RSS feeds"
+description = "Provides RSS feeds"
version = 1
diff --git a/modules/rss/views/feed.mrss.php b/modules/rss/views/feed.mrss.php
index 447179a5..3612cbc0 100644
--- a/modules/rss/views/feed.mrss.php
+++ b/modules/rss/views/feed.mrss.php
@@ -6,9 +6,9 @@
xmlns:fh="http://purl.org/syndication/history/1.0">
<channel>
<generator>gallery3</generator>
- <title><?= p::clean($feed->title) ?></title>
+ <title><?= html::clean($feed->title) ?></title>
<link><?= $feed->uri ?></link>
- <description><?= p::clean($feed->description) ?></description>
+ <description><?= html::clean($feed->description) ?></description>
<language>en-us</language>
<atom:link rel="self" href="<?= $feed->uri ?>" type="application/rss+xml" />
<fh:complete/>
@@ -22,25 +22,25 @@
<lastBuildDate><?= $pub_date ?></lastBuildDate>
<? foreach ($feed->children as $child): ?>
<item>
- <title><?= p::clean($child->title) ?></title>
+ <title><?= html::purify($child->title) ?></title>
<link><?= url::abs_site("{$child->type}s/{$child->id}") ?></link>
<guid isPermaLink="true"><?= url::abs_site("{$child->type}s/{$child->id}") ?></guid>
<pubDate><?= date("D, d M Y H:i:s T", $child->created); ?></pubDate>
<content:encoded>
<![CDATA[
- <span><?= p::clean($child->description) ?></span>
+ <span><?= html::purify($child->description) ?></span>
<p>
<? if ($child->type == "photo" || $child->type == "album"): ?>
<img alt="" src="<?= $child->resize_url(true) ?>"
- title="<?= p::clean($child->title) ?>"
+ title="<?= html::purify($child->title)->for_html_attr() ?>"
height="<?= $child->resize_height ?>" width="<?= $child->resize_width ?>" /><br />
<? else: ?>
<a href="<?= url::abs_site("{$child->type}s/{$child->id}") ?>">
<img alt="" src="<?= $child->thumb_url(true) ?>"
- title="<?= p::clean($child->title) ?>"
+ title="<?= html::purify($child->title)->for_html_attr() ?>"
height="<?= $child->thumb_height ?>" width="<?= $child->thumb_width ?>" /></a><br />
<? endif ?>
- <?= p::clean($child->description) ?>
+ <?= html::purify($child->description) ?>
</p>
]]>
</content:encoded>
diff --git a/modules/rss/views/rss_block.html.php b/modules/rss/views/rss_block.html.php
index 39921d7d..737731b6 100644
--- a/modules/rss/views/rss_block.html.php
+++ b/modules/rss/views/rss_block.html.php
@@ -5,7 +5,7 @@
<span class="ui-icon-left">
<a href="<?= rss::url($url) ?>">
<span class="ui-icon ui-icon-signal-diag"></span>
- <?= $title ?>
+ <?= html::purify($title) ?>
</a>
</span>
</li>