summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--classes/opml.php14
-rw-r--r--classes/pref/feeds.php8
-rw-r--r--include/functions.php2
-rw-r--r--index.php14
4 files changed, 20 insertions, 18 deletions
diff --git a/classes/opml.php b/classes/opml.php
index 4c188de5e..7a49f757c 100644
--- a/classes/opml.php
+++ b/classes/opml.php
@@ -253,13 +253,13 @@ class Opml extends Handler_Protected {
private function opml_import_feed($doc, $node, $cat_id, $owner_uid) {
$attrs = $node->attributes;
- $feed_title = db_escape_string($this->link, $attrs->getNamedItem('text')->nodeValue);
- if (!$feed_title) $feed_title = db_escape_string($this->link, $attrs->getNamedItem('title')->nodeValue);
+ $feed_title = db_escape_string($this->link, mb_substr($attrs->getNamedItem('text')->nodeValue, 0, 250));
+ if (!$feed_title) $feed_title = db_escape_string($this->link, mb_substr($attrs->getNamedItem('title')->nodeValue, 0, 250));
- $feed_url = db_escape_string($this->link, $attrs->getNamedItem('xmlUrl')->nodeValue);
- if (!$feed_url) $feed_url = db_escape_string($this->link, $attrs->getNamedItem('xmlURL')->nodeValue);
+ $feed_url = db_escape_string($this->link, mb_substr($attrs->getNamedItem('xmlUrl')->nodeValue, 0, 250));
+ if (!$feed_url) $feed_url = db_escape_string($this->link, mb_substr($attrs->getNamedItem('xmlURL')->nodeValue, 0, 250));
- $site_url = db_escape_string($this->link, $attrs->getNamedItem('htmlUrl')->nodeValue);
+ $site_url = db_escape_string($this->link, mb_substr($attrs->getNamedItem('htmlUrl')->nodeValue, 0, 250));
if ($feed_url && $feed_title) {
$result = db_query($this->link, "SELECT id FROM ttrss_feeds WHERE
@@ -386,10 +386,10 @@ class Opml extends Handler_Protected {
$default_cat_id = (int) get_feed_category($this->link, 'Imported feeds', false);
if ($root_node) {
- $cat_title = db_escape_string($this->link, $root_node->attributes->getNamedItem('text')->nodeValue);
+ $cat_title = db_escape_string($this->link, mb_substr($root_node->attributes->getNamedItem('text')->nodeValue, 0, 250));
if (!$cat_title)
- $cat_title = db_escape_string($this->link, $root_node->attributes->getNamedItem('title')->nodeValue);
+ $cat_title = db_escape_string($this->link, mb_substr($root_node->attributes->getNamedItem('title')->nodeValue, 0, 250));
if (!in_array($cat_title, array("tt-rss-filters", "tt-rss-labels", "tt-rss-prefs"))) {
$cat_id = get_feed_category($this->link, $cat_title, $parent_id);
diff --git a/classes/pref/feeds.php b/classes/pref/feeds.php
index 46c3d083b..eda03d126 100644
--- a/classes/pref/feeds.php
+++ b/classes/pref/feeds.php
@@ -1279,6 +1279,8 @@ class Pref_Feeds extends Handler_Protected {
dojoType=\"dijit.MenuItem\">".__('Reset sort order')."</div>";
print "<div onclick=\"batchSubscribe()\"
dojoType=\"dijit.MenuItem\">".__('Batch subscribe')."</div>";
+ print "<div dojoType=\"dijit.MenuItem\" onclick=\"removeSelectedFeeds()\">"
+ .__('Unsubscribe')."</div> ";
print "</div></div>";
if (get_pref($this->link, 'ENABLE_FEED_CATS')) {
@@ -1287,8 +1289,6 @@ class Pref_Feeds extends Handler_Protected {
print "<div dojoType=\"dijit.Menu\" style=\"display: none;\">";
print "<div onclick=\"createCategory()\"
dojoType=\"dijit.MenuItem\">".__('Add category')."</div>";
- print "<div onclick=\"toggleHiddenFeedCats()\"
- dojoType=\"dijit.MenuItem\">".__('(Un)hide empty categories')."</div>";
print "<div onclick=\"resetCatOrder()\"
dojoType=\"dijit.MenuItem\">".__('Reset sort order')."</div>";
print "<div onclick=\"removeSelectedCategories()\"
@@ -1300,8 +1300,8 @@ class Pref_Feeds extends Handler_Protected {
print $error_button;
print $inactive_button;
- print "<button dojoType=\"dijit.form.Button\" onclick=\"removeSelectedFeeds()\">"
- .__('Unsubscribe')."</button dojoType=\"dijit.form.Button\"> ";
+ print "<button onclick=\"toggleHiddenFeedCats()\"
+ dojoType=\"dijit.form.Button\">".__('(Un)hide empty categories')."</button>";
if (defined('_ENABLE_FEED_DEBUGGING')) {
diff --git a/include/functions.php b/include/functions.php
index a559ed1da..d321dc2ed 100644
--- a/include/functions.php
+++ b/include/functions.php
@@ -3406,6 +3406,8 @@
$parent_insert = "NULL";
}
+ $feed_cat = mb_substr($feed_cat, 0, 250);
+
$result = db_query($link,
"SELECT id FROM ttrss_feed_categories
WHERE $parent_qpart AND title = '$feed_cat' AND owner_uid = ".$_SESSION["uid"]);
diff --git a/index.php b/index.php
index ac2762f7f..3b905d1b1 100644
--- a/index.php
+++ b/index.php
@@ -201,15 +201,15 @@
</form>
- <?php
- global $pluginhost;
- foreach ($pluginhost->get_hooks($pluginhost::HOOK_TOOLBAR_BUTTON) as $p) {
- echo $p->hook_toolbar_button();
- }
- ?>
-
<div class="actionChooser">
+ <?php
+ global $pluginhost;
+ foreach ($pluginhost->get_hooks($pluginhost::HOOK_TOOLBAR_BUTTON) as $p) {
+ echo $p->hook_toolbar_button();
+ }
+ ?>
+
<button id="net-alert" dojoType="dijit.form.Button" style="display : none" disabled="true"
title="<?php echo __("Communication problem with server.") ?>">
<img