| Match: |
- ";
@@ -1964,6 +1964,8 @@
$feed_id = db_escape_string($_GET["feed_id"]);
$action_id = db_escape_string($_GET["action_id"]);
+ if (!$regexp) return;
+
if (!$feed_id) {
$feed_id = 'NULL';
} else {
@@ -2163,7 +2165,7 @@
print "";
print "| Caption: |
- ";
@@ -2301,7 +2303,9 @@
// no escaping is done here on purpose
$sql_exp = trim($_GET["sql_exp"]);
$description = db_escape_string($_GET["description"]);
-
+
+ if (!$sql_exp || !$description) return;
+
$result = db_query($link,
"INSERT INTO ttrss_labels (sql_exp,description,owner_uid)
VALUES ('$sql_exp', '$description', '".$_SESSION["uid"]."')");
@@ -2472,7 +2476,7 @@
print "
| Feed URL: |
| ";
@@ -2585,7 +2589,7 @@
print "";
print "| Caption: |
- ";
diff --git a/functions.js b/functions.js
index 64042c31a..6d108c683 100644
--- a/functions.js
+++ b/functions.js
@@ -1223,6 +1223,14 @@ function qaddFilter() {
return
}
+ var form = document.forms['filter_add_form'];
+ var reg_exp = form.reg_exp.value;
+
+ if (reg_exp == "") {
+ alert("Can't add filter: nothing to match on.");
+ return false;
+ }
+
var query = Form.serialize("filter_add_form");
xmlhttp.open("GET", "backend.php?" + query, true);
@@ -1251,6 +1259,14 @@ function qafAdd() {
return
}
+ var form = document.forms['feed_add_form'];
+ var feed_url = form.feed_url.value;
+
+ if (feed_url == "") {
+ alert("Can't subscribe: no feed URL given.");
+ return false;
+ }
+
notify("Adding feed...", true);
closeInfoBox();
diff --git a/functions.php b/functions.php
index 02228c886..1556afc68 100644
--- a/functions.php
+++ b/functions.php
@@ -1877,7 +1877,9 @@
function subscribe_to_feed($link, $feed_link, $cat_id = 0) {
- $feed_link = preg_replace("/^feed:/", "", $feed_link);
+ $feed_link = trim(preg_replace("/^feed:/", "", $feed_link));
+
+ if ($feed_link == "") return;
if ($cat_id == "0" || !$cat_id) {
$cat_qpart = "NULL";
diff --git a/schema/ttrss_schema_mysql.sql b/schema/ttrss_schema_mysql.sql
index 68c081cbd..ada03bc44 100644
--- a/schema/ttrss_schema_mysql.sql
+++ b/schema/ttrss_schema_mysql.sql
@@ -241,8 +241,6 @@ insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id) valu
insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id,help_text) values('COMBINED_DISPLAY_MODE', 1, 'false', 'Combined feed display',2,
'Display expanded list of feed articles, instead of separate displays for headlines and article content');
-insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id) values('ENABLE_SEARCH_TOOLBAR', 1, 'false', 'Enable search toolbar',3);
-
insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id) values('HIDE_READ_FEEDS', 1, 'false', 'Hide feeds with no unread messages',2);
insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id) values('OPEN_LINKS_IN_NEW_WINDOW', 1, 'true', 'Open article links in new browser window',2);
diff --git a/schema/ttrss_schema_pgsql.sql b/schema/ttrss_schema_pgsql.sql
index c9fb739eb..83a837c9e 100644
--- a/schema/ttrss_schema_pgsql.sql
+++ b/schema/ttrss_schema_pgsql.sql
@@ -221,8 +221,6 @@ insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id) valu
insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id,help_text) values('COMBINED_DISPLAY_MODE', 1, 'false', 'Combined feed display',2,
'Display expanded list of feed articles, instead of separate displays for headlines and article content');
-insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id) values('ENABLE_SEARCH_TOOLBAR', 1, 'false', 'Enable search toolbar',3);
-
insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id) values('HIDE_READ_FEEDS', 1, 'false', 'Hide feeds with no unread messages',2);
insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id) values('OPEN_LINKS_IN_NEW_WINDOW', 1, 'true', 'Open article links in new browser window',2);
diff --git a/schema/upgrade-1.2.3-1.2.4-mysql.sql b/schema/upgrade-1.2.3-1.2.4-mysql.sql
index 2de774267..664419aa1 100644
--- a/schema/upgrade-1.2.3-1.2.4-mysql.sql
+++ b/schema/upgrade-1.2.3-1.2.4-mysql.sql
@@ -2,9 +2,11 @@ begin;
delete FROM ttrss_user_prefs WHERE pref_name = 'DISPLAY_HEADER';
delete FROM ttrss_user_prefs WHERE pref_name = 'DISPLAY_FOOTER';
+delete FROM ttrss_user_prefs WHERE pref_name = 'ENABLE_SEARCH_TOOLBAR';
delete FROM ttrss_prefs WHERE pref_name = 'DISPLAY_HEADER';
delete FROM ttrss_prefs WHERE pref_name = 'DISPLAY_FOOTER';
+delete FROM ttrss_prefs WHERE pref_name = 'ENABLE_SEARCH_TOOLBAR';
insert into ttrss_themes (theme_name, theme_path)
values ('Graycube', 'graycube');
diff --git a/schema/upgrade-1.2.3-1.2.4-pgsql.sql b/schema/upgrade-1.2.3-1.2.4-pgsql.sql
index 2de774267..664419aa1 100644
--- a/schema/upgrade-1.2.3-1.2.4-pgsql.sql
+++ b/schema/upgrade-1.2.3-1.2.4-pgsql.sql
@@ -2,9 +2,11 @@ begin;
delete FROM ttrss_user_prefs WHERE pref_name = 'DISPLAY_HEADER';
delete FROM ttrss_user_prefs WHERE pref_name = 'DISPLAY_FOOTER';
+delete FROM ttrss_user_prefs WHERE pref_name = 'ENABLE_SEARCH_TOOLBAR';
delete FROM ttrss_prefs WHERE pref_name = 'DISPLAY_HEADER';
delete FROM ttrss_prefs WHERE pref_name = 'DISPLAY_FOOTER';
+delete FROM ttrss_prefs WHERE pref_name = 'ENABLE_SEARCH_TOOLBAR';
insert into ttrss_themes (theme_name, theme_path)
values ('Graycube', 'graycube');
diff --git a/tt-rss.php b/tt-rss.php
index 35d14715f..9d6a556e9 100644
--- a/tt-rss.php
+++ b/tt-rss.php
@@ -152,15 +152,10 @@ window.onload = init;
| | |