Commit f9a858db authored by Sebastian Reichel's avatar Sebastian Reichel

Imported Upstream version 1.5.10

parent 75cd221b
......@@ -160,6 +160,9 @@ class API extends Handler {
if ($feed_id != "") {
$limit = (int)db_escape_string($_REQUEST["limit"]);
if (!$limit || $limit >= 60) $limit = 60;
$offset = (int)db_escape_string($_REQUEST["skip"]);
$filter = db_escape_string($_REQUEST["filter"]);
$is_cat = (bool)db_escape_string($_REQUEST["is_cat"]);
......
......@@ -8,9 +8,21 @@ class Backend extends Handler {
}
function digestSend() {
define('PREFS_NO_CACHE', true);
send_headlines_digests($this->link);
}
function digestTest() {
header("Content-type: text/html");
$rv = prepare_headlines_digest($this->link, $_SESSION['uid'], 1, 1000);
$rv[3] = "<pre>" . $rv[3] . "</pre>";
print_r($rv);
}
function help() {
$topic = basename($_REQUEST["topic"]);
......
......@@ -284,12 +284,13 @@ class Dlg extends Protected_Handler {
" <input
placeHolder=\"".__("Password")."\"
dojoType=\"dijit.form.TextBox\" type='password'
style=\"width : 10em;\" name='pass'\">
style=\"width : 10em;\" name='pass'\">".
" <p class='insensitive'>".__("OAuth will be used automatically for Twitter feeds.")."</p>
</div></div>";
print "<div style=\"clear : both\">
<input type=\"checkbox\" dojoType=\"dijit.form.CheckBox\" id=\"feedDlg_loginCheck\"
<input type=\"checkbox\" name=\"need_auth\" dojoType=\"dijit.form.CheckBox\" id=\"feedDlg_loginCheck\"
onclick='checkboxToggleElement(this, \"feedDlg_loginContainer\")'>
<label for=\"feedDlg_loginCheck\">".
__('This feed requires authentication.')."</div>";
......@@ -977,5 +978,54 @@ class Dlg extends Protected_Handler {
}
function batchSubscribe() {
print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"op\" value=\"rpc\">";
print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"method\" value=\"batchaddfeeds\">";
print "<table width='100%'><tr><td>
".__("Add one valid RSS feed per line (no feed detection is done)")."
</td><td align='right'>";
if (get_pref($this->link, 'ENABLE_FEED_CATS')) {
print __('Place in category:') . " ";
print_feed_cat_select($this->link, "cat", false, 'dojoType="dijit.form.Select"');
}
print "</td></tr><tr><td colspan='2'>";
print "<textarea
style='font-size : 12px; width : 100%; height: 200px;'
placeHolder=\"".__("Feeds to subscribe, One per line")."\"
dojoType=\"dijit.form.SimpleTextarea\" required=\"1\" name=\"feeds\"></textarea>";
print "</td></tr><tr><td colspan='2'>";
print "<div id='feedDlg_loginContainer' style='display : none'>
" .
" <input dojoType=\"dijit.form.TextBox\" name='login'\"
placeHolder=\"".__("Login")."\"
style=\"width : 10em;\"> ".
" <input
placeHolder=\"".__("Password")."\"
dojoType=\"dijit.form.TextBox\" type='password'
style=\"width : 10em;\" name='pass'\">".
" <p class='insensitive'>".__("OAuth will be used automatically for Twitter feeds.")."</p>
</div>";
print "</td></tr><tr><td colspan='2'>";
print "<div style=\"clear : both\">
<input type=\"checkbox\" name=\"need_auth\" dojoType=\"dijit.form.CheckBox\" id=\"feedDlg_loginCheck\"
onclick='checkboxToggleElement(this, \"feedDlg_loginContainer\")'>
<label for=\"feedDlg_loginCheck\">".
__('Feeds require authentication.')."</div>";
print "</form>";
print "</td></tr></table>";
print "<div class=\"dlgButtons\">
<button dojoType=\"dijit.form.Button\" onclick=\"return dijit.byId('batchSubDlg').execute()\">".__('Subscribe')."</button>
<button dojoType=\"dijit.form.Button\" onclick=\"return dijit.byId('batchSubDlg').hide()\">".__('Cancel')."</button>
</div>";
}
}
?>
......@@ -1317,6 +1317,8 @@ class Pref_Feeds extends Protected_Handler {
dojoType=\"dijit.MenuItem\">".__('Edit selected feeds')."</div>";
print "<div onclick=\"resetFeedOrder()\"
dojoType=\"dijit.MenuItem\">".__('Reset sort order')."</div>";
print "<div onclick=\"batchSubscribe()\"
dojoType=\"dijit.MenuItem\">".__('Batch subscribe')."</div>";
print "</div></div>";
if (get_pref($this->link, 'ENABLE_FEED_CATS')) {
......@@ -1498,7 +1500,7 @@ class Pref_Feeds extends Protected_Handler {
print "</div>"; #pane
print "<div dojoType=\"dijit.layout.AccordionPane\" title=\"".__('Published & shared articles and generated feeds')."\">";
print "<div dojoType=\"dijit.layout.AccordionPane\" title=\"".__('Published & shared articles / Generated feeds')."\">";
print "<h3>" . __("Published articles and generated feeds") . "</h3>";
......
......@@ -33,55 +33,65 @@ class Pref_Filters extends Protected_Handler {
else
$feed = -4;
$feed_title = getFeedTitle($this->link, $feed);
$qfh_ret = queryFeedHeadlines($this->link, $cat_filter ? $cat_id : $feed,
30, "", $cat_filter, false, false,
false, "date_entered DESC", 0, $_SESSION["uid"], $filter);
$result = $qfh_ret[0];
$articles = array();
$found = 0;
$regexp_valid = preg_match('/' . $filter['reg_exp'] . '/',
$filter['reg_exp']) !== FALSE;
print __("Articles matching this filter:");
print "<div class=\"inactiveFeedHolder\">";
print "<table width=\"100%\" cellspacing=\"0\" id=\"prefErrorFeedList\">";
while ($line = db_fetch_assoc($result)) {
if ($regexp_valid) {
$entry_timestamp = strtotime($line["updated"]);
$entry_tags = get_article_tags($this->link, $line["id"], $_SESSION["uid"]);
$feed_title = getFeedTitle($this->link, $feed);
$content_preview = truncate_string(
strip_tags($line["content_preview"]), 100, '...');
$qfh_ret = queryFeedHeadlines($this->link, $cat_filter ? $cat_id : $feed,
30, "", $cat_filter, false, false,
false, "date_entered DESC", 0, $_SESSION["uid"], $filter);
if ($line["feed_title"])
$feed_title = $line["feed_title"];
$result = $qfh_ret[0];
print "<tr>";
$articles = array();
$found = 0;
print "<td width='5%' align='center'><input
dojoType=\"dijit.form.CheckBox\" checked=\"1\"
disabled=\"1\" type=\"checkbox\"></td>";
print "<td>";
while ($line = db_fetch_assoc($result)) {
print $line["title"];
print "&nbsp;(";
print "<b>" . $feed_title . "</b>";
print "):&nbsp;";
print "<span class=\"insensitive\">" . $content_preview . "</span>";
print " " . mb_substr($line["date_entered"], 0, 16);
$entry_timestamp = strtotime($line["updated"]);
$entry_tags = get_article_tags($this->link, $line["id"], $_SESSION["uid"]);
print "</td></tr>";
$content_preview = truncate_string(
strip_tags($line["content_preview"]), 100, '...');
$found++;
}
if ($line["feed_title"])
$feed_title = $line["feed_title"];
print "<tr>";
print "<td width='5%' align='center'><input
dojoType=\"dijit.form.CheckBox\" checked=\"1\"
disabled=\"1\" type=\"checkbox\"></td>";
print "<td>";
print $line["title"];
print "&nbsp;(";
print "<b>" . $feed_title . "</b>";
print "):&nbsp;";
print "<span class=\"insensitive\">" . $content_preview . "</span>";
print " " . mb_substr($line["date_entered"], 0, 16);
print "</td></tr>";
$found++;
}
if ($found == 0) {
print "<tr><td align='center'>" .
__("No articles matching this filter has been found.") . "</td></tr>";
}
} else {
print "<tr><td align='center' class='error'>" .
__("Invalid regular expression.") . "</td></tr>";
if ($found == 0) {
print "<tr><td align='center'>" .
__("No articles matching this filter has been found.") . "</td></tr>";
}
print "</table>";
......
......@@ -28,34 +28,43 @@ class Pref_Prefs extends Protected_Handler {
return;
}
$old_pw_hash1 = encrypt_password($old_pw);
$old_pw_hash2 = encrypt_password($old_pw, $_SESSION["name"]);
$new_pw_hash = encrypt_password($new_pw, $_SESSION["name"]);
$result = db_query($this->link, "SELECT salt FROM ttrss_users WHERE
id = " . $_SESSION['uid']);
$active_uid = $_SESSION["uid"];
$salt = db_fetch_result($result, 0, "salt");
if ($old_pw && $new_pw) {
if (!$salt) {
$old_pw_hash1 = encrypt_password($old_pw);
$old_pw_hash2 = encrypt_password($old_pw, $_SESSION["name"]);
$login = db_escape_string($_SERVER['PHP_AUTH_USER']);
$query = "SELECT id FROM ttrss_users WHERE
id = ".$_SESSION['uid']." AND (pwd_hash = '$old_pw_hash1' OR
pwd_hash = '$old_pw_hash2')";
$result = db_query($this->link, "SELECT id FROM ttrss_users WHERE
id = '$active_uid' AND (pwd_hash = '$old_pw_hash1' OR
pwd_hash = '$old_pw_hash2')");
} else {
$old_pw_hash = encrypt_password($old_pw, $salt, true);
if (db_num_rows($result) == 1) {
db_query($this->link, "UPDATE ttrss_users SET pwd_hash = '$new_pw_hash'
WHERE id = '$active_uid'");
$query = "SELECT id FROM ttrss_users WHERE
id = ".$_SESSION['uid']." AND pwd_hash = '$old_pw_hash'";
}
$_SESSION["pwd_hash"] = $new_pw_hash;
$result = db_query($this->link, $query);
print __("Password has been changed.");
} else {
print "ERROR: ".__('Old password is incorrect.');
}
}
if (db_num_rows($result) == 1) {
return;
$new_salt = substr(bin2hex(get_random_bytes(125)), 0, 250);
$new_pw_hash = encrypt_password($new_pw, $new_salt, true);
db_query($this->link, "UPDATE ttrss_users SET
pwd_hash = '$new_pw_hash', salt = '$new_salt'
WHERE id = ".$_SESSION['uid']);
$_SESSION["pwd_hash"] = $new_pw_hash;
print __("Password has been changed.");
} else {
print "ERROR: ".__('Old password is incorrect.');
}
}
function saveconfig() {
......@@ -69,6 +78,15 @@ class Pref_Prefs extends Protected_Handler {
$pref_name = db_escape_string($pref_name);
$value = db_escape_string($_POST[$pref_name]);
if ($pref_name == 'DIGEST_PREFERRED_TIME') {
if (get_pref($this->link, 'DIGEST_PREFERRED_TIME') != $value) {
db_query($this->link, "UPDATE ttrss_users SET
last_digest_sent = NULL WHERE id = " . $_SESSION['uid']);
}
}
set_pref($this->link, $pref_name, $value);
}
......@@ -139,7 +157,7 @@ class Pref_Prefs extends Protected_Handler {
"PURGE_UNREAD_ARTICLES", "DIGEST_ENABLE", "DIGEST_CATCHUP",
"BLACKLISTED_TAGS", "ENABLE_API_ACCESS", "UPDATE_POST_ON_CHECKSUM_CHANGE",
"DEFAULT_UPDATE_INTERVAL", "USER_TIMEZONE", "SORT_HEADLINES_BY_FEED_DATE",
"SSL_CERT_SERIAL");
"SSL_CERT_SERIAL", "DIGEST_PREFERRED_TIME");
if (!SINGLE_USER_MODE) {
......@@ -147,7 +165,7 @@ class Pref_Prefs extends Protected_Handler {
$_SESSION["prefs_op_result"] = "";
print "<div dojoType=\"dijit.layout.AccordionContainer\" region=\"center\">";
print "<div dojoType=\"dijit.layout.AccordionPane\" title=\"".__('Personal data')."\">";
print "<div dojoType=\"dijit.layout.AccordionPane\" title=\"".__('Personal data / Authentication')."\">";
print "<form dojoType=\"dijit.form.Form\" id=\"changeUserdataForm\">";
......@@ -197,9 +215,6 @@ class Pref_Prefs extends Protected_Handler {
print "</form>";
print "</div>"; # pane
print "<div dojoType=\"dijit.layout.AccordionPane\" title=\"".__('Authentication')."\">";
$result = db_query($this->link, "SELECT id FROM ttrss_users
WHERE id = ".$_SESSION["uid"]." AND pwd_hash
= 'SHA1:5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8'");
......@@ -455,6 +470,11 @@ class Pref_Prefs extends Protected_Handler {
onclick=\"insertSSLserial('')\">" .
__('Clear') . "</button>";
} else if ($pref_name == 'DIGEST_PREFERRED_TIME') {
print "<input dojoType=\"dijit.form.ValidationTextBox\"
id=\"$pref_name\" regexp=\"[012]?\d:\d\d\" placeHolder=\"12:00\"
name=\"$pref_name\" value=\"$value\"><div class=\"insensitive\">".
T_sprintf("Current server time: %s (UTC)", date("H:i")) . "</div>";
} else {
$regexp = ($type_name == 'integer') ? 'regexp="^\d*$"' : '';
......
......@@ -206,8 +206,9 @@ class Pref_Users extends Protected_Handler {
$password = db_escape_string(trim($_REQUEST["password"]));
if ($password) {
$pwd_hash = encrypt_password($password, $login);
$pass_query_part = "pwd_hash = '$pwd_hash', ";
$salt = substr(bin2hex(get_random_bytes(125)), 0, 250);
$pwd_hash = encrypt_password($password, $salt, true);
$pass_query_part = "pwd_hash = '$pwd_hash', salt = '$salt',";
} else {
$pass_query_part = "";
}
......@@ -233,7 +234,8 @@ class Pref_Users extends Protected_Handler {
$login = db_escape_string(trim($_REQUEST["login"]));
$tmp_user_pwd = make_password(8);
$pwd_hash = encrypt_password($tmp_user_pwd, $login);
$salt = substr(bin2hex(get_random_bytes(125)), 0, 250);
$pwd_hash = encrypt_password($tmp_user_pwd, $salt, true);
$result = db_query($this->link, "SELECT id FROM ttrss_users WHERE
login = '$login'");
......@@ -241,8 +243,8 @@ class Pref_Users extends Protected_Handler {
if (db_num_rows($result) == 0) {
db_query($this->link, "INSERT INTO ttrss_users
(login,pwd_hash,access_level,last_login,created)
VALUES ('$login', '$pwd_hash', 0, null, NOW())");
(login,pwd_hash,access_level,last_login,created, salt)
VALUES ('$login', '$pwd_hash', 0, null, NOW(), '$salt')");
$result = db_query($this->link, "SELECT id FROM ttrss_users WHERE
......@@ -276,10 +278,14 @@ class Pref_Users extends Protected_Handler {
$login = db_fetch_result($result, 0, "login");
$email = db_fetch_result($result, 0, "email");
$salt = db_fetch_result($result, 0, "salt");
$new_salt = substr(bin2hex(get_random_bytes(125)), 0, 250);
$tmp_user_pwd = make_password(8);
$pwd_hash = encrypt_password($tmp_user_pwd, $login);
db_query($this->link, "UPDATE ttrss_users SET pwd_hash = '$pwd_hash'
$pwd_hash = encrypt_password($tmp_user_pwd, $new_salt, true);
db_query($this->link, "UPDATE ttrss_users SET pwd_hash = '$pwd_hash', salt = '$new_salt'
WHERE id = '$uid'");
print T_sprintf("Changed password of user <b>%s</b>
......
<?php
class ReadItLater_Button extends Plugin_Button {
function render($article_id) {
$rv = "<img src=\"".theme_image($this->link, 'images/art-readitlater.png')."\"
class='tagsPic' style=\"cursor : pointer\"
onclick=\"readArticleLater($article_id)\"
title='".__('Read it later')."'>";
return $rv;
}
function getInfo() {
$id = db_escape_string($_REQUEST['id']);
$result = db_query($this->link, "SELECT title, link
FROM ttrss_entries, ttrss_user_entries
WHERE id = '$id' AND ref_id = id AND owner_uid = " .$_SESSION['uid']);
if (db_num_rows($result) != 0) {
$title = truncate_string(strip_tags(db_fetch_result($result, 0, 'title')),
100, '...');
$article_link = db_fetch_result($result, 0, 'link');
}
print json_encode(array("title" => $title, "link" => $article_link,
"id" => $id));
}
}
?>
......@@ -188,8 +188,9 @@ class RPC extends Protected_Handler {
$cat = db_escape_string($_REQUEST['cat']);
$login = db_escape_string($_REQUEST['login']);
$pass = db_escape_string($_REQUEST['pass']);
$need_auth = db_escape_string($_REQUEST['need_auth']) != "";
$rc = subscribe_to_feed($this->link, $feed, $cat, $login, $pass);
$rc = subscribe_to_feed($this->link, $feed, $cat, $login, $pass, $need_auth);
print json_encode(array("result" => $rc));
}
......@@ -209,12 +210,11 @@ class RPC extends Protected_Handler {
}
function setpref() {
// set_pref escapes input, so no need to double escape it here
$key = $_REQUEST['key'];
$value = str_replace("\n", "<br/>", $_REQUEST['value']);
$key = db_escape_string($_REQUEST["key"]);
$value = db_escape_string($value);
set_pref($this->link, $key, $value);
set_pref($this->link, $key, $value, $_SESSION['uid'], $key != 'USER_STYLESHEET');
print json_encode(array("param" =>$key, "value" => $value));
}
......@@ -787,5 +787,54 @@ class RPC extends Protected_Handler {
print json_encode(array("hash" => $hash));
}
function batchAddFeeds() {
$cat_id = db_escape_string($_REQUEST['cat']);
$feeds = explode("\n", db_escape_string($_REQUEST['feeds']));
$login = db_escape_string($_REQUEST['login']);
$pass = db_escape_string($_REQUEST['pass']);
$need_auth = db_escape_string($_REQUEST['need_auth']) != "";
$result = db_query($this->link, "SELECT twitter_oauth FROM ttrss_users
WHERE id = ".$_SESSION['uid']);
$has_oauth = db_fetch_result($result, 0, 'twitter_oauth') != "";
foreach ($feeds as $feed) {
$feed = trim($feed);
if (validate_feed_url($feed)) {
db_query($this->link, "BEGIN");
if (!$need_auth || !$has_oauth || strpos($url, '://api.twitter.com')
=== false) {
$update_method = 0;
} else {
$update_method = 3;
}
if ($cat_id == "0" || !$cat_id) {
$cat_qpart = "NULL";
} else {
$cat_qpart = "'$cat_id'";
}
$result = db_query($this->link,
"SELECT id FROM ttrss_feeds
WHERE feed_url = '$feed' AND owner_uid = ".$_SESSION["uid"]);
if (db_num_rows($result) == 0) {
$result = db_query($this->link,
"INSERT INTO ttrss_feeds
(owner_uid,feed_url,title,cat_id,auth_login,auth_pass,update_method)
VALUES ('".$_SESSION["uid"]."', '$feed',
'[Unknown]', $cat_qpart, '$login', '$pass', '$update_method')");
}
db_query($this->link, "COMMIT");
}
}
}
}
?>
......@@ -194,7 +194,8 @@
define('ARTICLE_BUTTON_PLUGINS', 'note,tweet,share,mail');
// Comma-separated list of additional article action button plugins
// to enable, like tweet button, etc.
// The following plugins are available: note, tweet, share, mail, readitlater
// The following plugins are available: note, tweet, share, mail
// More plugins: http://tt-rss.org/wiki/Plugins
define('CONFIG_VERSION', 25);
// Expected config version. Please update this option in config.php
......
......@@ -117,7 +117,7 @@ a:hover {
#article #article-content {
padding : 0px;
font-height : 16px;
font-size : 16px;
}
#article #article-content #tags {
......
......@@ -2,7 +2,7 @@
require_once "config.php";
require_once "db.php";
if (!defined('DISABLE_SESSIONS')) {
if (!defined('DISABLE_SESSIONS') && !defined('PREFS_NO_CACHE')) {
if (!$_SESSION["prefs_cache"])
$_SESSION["prefs_cache"] = array();
}
......@@ -21,7 +21,7 @@
//$prefs_cache = false;
}
if ($prefs_cache && !defined('DISABLE_SESSIONS')) {
if ($prefs_cache && !defined('DISABLE_SESSIONS') && !defined('PREFS_NO_CACHE')) {
if ($_SESSION["prefs_cache"] && @$_SESSION["prefs_cache"][$pref_name]) {
$tuple = $_SESSION["prefs_cache"][$pref_name];
return convert_pref_type($tuple["value"], $tuple["type"]);
......@@ -79,9 +79,9 @@
}
}
function set_pref($link, $pref_name, $value, $user_id = false) {
function set_pref($link, $pref_name, $value, $user_id = false, $strip_tags = true) {
$pref_name = db_escape_string($pref_name);
$value = db_escape_string($value);
$value = db_escape_string($value, $strip_tags);
if (!$user_id) {
$user_id = $_SESSION["uid"];
......@@ -102,7 +102,7 @@
$type_name = "";
$current_value = "";
if (!defined('DISABLE_SESSIONS')) {
if (!defined('DISABLE_SESSIONS') && !defined('PREFS_NO_CACHE')) {
if ($_SESSION["prefs_cache"] && @$_SESSION["prefs_cache"][$pref_name]) {
$type_name = $_SESSION["prefs_cache"][$pref_name]["type"];
$current_value = $_SESSION["prefs_cache"][$pref_name]["value"];
......
This diff is collapsed.
<?php # This file has been generated at: Wed Dec 28 13:33:46 MSK 2011
<?php # This file has been generated at: Mon Jan 30 16:39:34 MSK 2012
__("Title");
__("Title or Content");
......@@ -29,6 +29,7 @@ __('When this option is enabled, headlines in Special feeds and Labels are group
__('Use feed-specified date to sort headlines instead of local import date.');
__('Customize CSS stylesheet to your liking');
__('Click to register your SSL client certificate with tt-rss');
__('Uses server timezone');
__('Purge old posts after this number of days (0 - disables)');
__('Default interval between feed updates');
__('Amount of articles to display at once');
......@@ -59,4 +60,5 @@ __('User timezone');
__('Sort headlines by feed date');
__('Customize stylesheet');
__('Login with an SSL certificate');
__('Try to send digests around specified time');
?>
......@@ -60,6 +60,8 @@
function update_daemon_common($link, $limit = DAEMON_FEED_LIMIT, $from_http = false, $debug = true) {
// Process all other feeds using last_updated and interval parameters
define('PREFS_NO_CACHE', true);
// Test if the user has loggued in recently. If not, it does not update its feeds.
if (!SINGLE_USER_MODE && DAEMON_UPDATE_LOGIN_LIMIT > 0) {
if (DB_TYPE == "pgsql") {
......@@ -149,13 +151,15 @@
}
// Send feed digests by email if needed.
send_headlines_digests($link, 100, $debug);
send_headlines_digests($link, $debug);
} // function update_daemon_common
function fetch_twitter_rss($link, $url, $owner_uid) {
require_once 'lib/tmhoauth/tmhOAuth.php';
require_once "lib/magpierss/rss_fetch.inc";
require_once 'lib/magpierss/rss_utils.inc';
$result = db_query($link, "SELECT twitter_oauth FROM ttrss_users
WHERE id = $owner_uid");
......@@ -1351,7 +1355,7 @@
$node = $doc->getElementsByTagName('body')->item(0);
return $doc->saveXML($node);
return $doc->saveXML($node, LIBXML_NOEMPTYTAG);
}
function expire_cached_files($debug) {
......
......@@ -6,11 +6,15 @@
} else {
define('EXPECTED_CONFIG_VERSION', 25);
define('SCHEMA_VERSION', 87);
define('SCHEMA_VERSION', 89);
require_once "config.php";
require_once "sanity_config.php";
if (function_exists('posix_getuid') && posix_getuid() == 0) {
$err_msg = "Please don't run this script as root.";
}
if (CONFIG_VERSION != EXPECTED_CONFIG_VERSION) {
$err_msg = "Configuration file (config.php) has incorrect version. Update it with new options from config.php-dist and set CONFIG_VERSION to the correct value.";
}
......@@ -116,7 +120,7 @@
}
}
if ($err_msg) { ?>
if ($err_msg && defined($_SERVER['REQUEST_URI'])) { ?>
<html>
<head>
<title>Fatal error</title>
......@@ -142,6 +146,8 @@
<?php
die;
} else if ($err_msg) {
die("[sanity_check] $err_msg\n");
}
?>
<?php
define('VERSION', "1.5.9");
define('VERSION', "1.5.10");
?>
......@@ -94,6 +94,9 @@ dojo.declare("fox.FeedStoreModel", dijit.tree.ForestStoreModel, {
});
dojo.declare("fox.FeedTree", dijit.Tree, {
_onKeyPress: function(/* Event */ e) {
return; // Stop dijit.Tree from interpreting keystrokes
},
_createTreeNode: function(args) {
var tnode = new dijit._TreeNode(args);
......
......@@ -982,19 +982,39 @@ function quickAddFilter() {
test: function() {
if (this.validate()) {
if (dijit.byId("filterTestDlg"))
dijit.byId("filterTestDlg").destroyRecursive();
var query = "?op=rpc&method=verifyRegexp&reg_exp=" +
param_escape(dialog.attr('value').reg_exp);
notify_progress("Verifying regular expression...");
new Ajax.Request("backend.php", {
parameters: query,
onComplete: function(transport) {
var reply = JSON.parse(transport.responseText);
if (reply) {
notify('');
if (!reply['status']) {
alert("Invalid regular expression.");
return;
} else {
tdialog = new dijit.Dialog({
id: "filterTestDlg",
title: __("Filter Test Results"),
style: "width: 600px",
href: "backend.php?savemode=test&" +
dojo.objectToQuery(dialog.attr('value')),
});
if (dijit.byId("filterTestDlg"))
dijit.byId("filterTestDlg").destroyRecursive();
tdialog.show();
tdialog = new dijit.Dialog({
id: "filterTestDlg",
title: __("Filter Test Results"),