Index: openacs-4/packages/news-aggregator/tcl/aggregator-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/news-aggregator/tcl/aggregator-procs.tcl,v
diff -u -r1.3 -r1.4
--- openacs-4/packages/news-aggregator/tcl/aggregator-procs.tcl 7 Apr 2018 11:09:13 -0000 1.3
+++ openacs-4/packages/news-aggregator/tcl/aggregator-procs.tcl 7 Apr 2018 16:58:52 -0000 1.4
@@ -118,7 +118,7 @@
$link_node appendChild $text_node
$item_node appendChild $link_node
- if { ![string equal $content_encoded ""] } {
+ if { $content_encoded ne "" } {
set content $content_encoded
} else {
set content $item_description
@@ -155,7 +155,7 @@
}
set limit [parameter::get -package_id $package_id -parameter "number_of_items_shown"]
- set sql_limit [expr $limit_multiple*$limit]
+ set sql_limit [expr {$limit_multiple*$limit}]
set sql [db_map items]
return $sql
@@ -292,9 +292,9 @@
} {
set aggregator_id [db_string find_default {} -default 0]
- if { [string equal $aggregator_id "0"] } {
+ if {$aggregator_id eq "0"} {
set aggregator_id [db_string lowest_aggregator ""]
- if { [exists_and_not_null aggregator_id] } {
+ if { ([info exists aggregator_id] && $aggregator_id ne "") } {
news_aggregator::aggregator::set_user_default \
-user_id $user_id \
-aggregator_id $aggregator_id
@@ -341,15 +341,15 @@
@creation-date 2003-06-29
} {
- if { ![exists_and_not_null creation_user] } {
+ if { (![info exists creation_user] || $creation_user eq "") } {
set creation_user [ad_conn user_id]
}
- if { ![exists_and_not_null creation_ip] } {
+ if { (![info exists creation_ip] || $creation_ip eq "") } {
set creation_ip [ad_conn peeraddr]
}
- if { ![exists_and_not_null package_id] } {
+ if { (![info exists package_id] || $package_id eq "") } {
set package_id [ad_conn package_id]
}
Index: openacs-4/packages/news-aggregator/tcl/news-aggregator-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/news-aggregator/tcl/news-aggregator-procs.tcl,v
diff -u -r1.9 -r1.10
--- openacs-4/packages/news-aggregator/tcl/news-aggregator-procs.tcl 13 Jan 2005 13:58:27 -0000 1.9
+++ openacs-4/packages/news-aggregator/tcl/news-aggregator-procs.tcl 7 Apr 2018 16:58:52 -0000 1.10
@@ -32,10 +32,10 @@
if {$diff < 120 && $diff > 60} {
set to_return "1 hour and "
} elseif {$diff >= 60} {
- set to_return "[expr $diff / 60] hours and "
+ set to_return "[expr {$diff / 60}] hours and "
}
- set mins [expr $diff % 60]
- if {[string equal 1 $mins]} {
+ set mins [expr {$diff % 60}]
+ if {"1" eq $mins} {
append to_return "1 minute ago"
} else {
append to_return "$mins minutes ago"
Index: openacs-4/packages/news-aggregator/tcl/opml-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/news-aggregator/tcl/opml-procs.tcl,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/news-aggregator/tcl/opml-procs.tcl 20 Mar 2004 11:04:39 -0000 1.1
+++ openacs-4/packages/news-aggregator/tcl/opml-procs.tcl 7 Apr 2018 16:58:52 -0000 1.2
@@ -20,7 +20,7 @@
set doc [dom parse $xml]
set doc_node [$doc documentElement]
- if { ![string equal [$doc_node nodeName] "opml"] } {
+ if { [$doc_node nodeName] ne "opml" } {
error "Document element is not opml"
}
@@ -36,7 +36,7 @@
error "There is not exactly one title element in head: $title_texts"
}
set title_text [[lindex $title_texts 0] nodeValue]
- if { ![string equal $title_text "mySubscriptions"] } {
+ if { $title_text ne "mySubscriptions" } {
error "OPML title is not 'mySubscriptions'. This does not appear to be an OPML file in mySubscriptions format."
}
@@ -55,8 +55,8 @@
set url [$node getAttribute xmlUrl ""]
set html_url [$node getAttribute htmlUrl ""]
- if { ![string equal $title ""] && ![string equal url ""] &&
- ![string equal $html_url ""] &&
+ if { $title ne "" && ![string equal url ""] &&
+ $html_url ne "" &&
[util_url_valid_p $url] } {
set feed(title) $title
set feed(url) $url
Index: openacs-4/packages/news-aggregator/tcl/source-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/news-aggregator/tcl/source-procs.tcl,v
diff -u -r1.7 -r1.8
--- openacs-4/packages/news-aggregator/tcl/source-procs.tcl 7 Apr 2018 11:09:13 -0000 1.7
+++ openacs-4/packages/news-aggregator/tcl/source-procs.tcl 7 Apr 2018 16:58:52 -0000 1.8
@@ -25,7 +25,7 @@
if { [db_0or1row source {}] } {
ns_log Debug "news_aggregator::source::new: Source exists"
- if { [exists_and_not_null aggregator_id] } {
+ if { ([info exists aggregator_id] && $aggregator_id ne "") } {
ns_log Debug "news_aggregator::source::new: Source exists, creating new subscription"
news_aggregator::subscription::new \
-aggregator_id $aggregator_id \
@@ -49,7 +49,7 @@
array set f [ad_httpget -url $feed_url -depth 4]
- if { ![string equal 200 $f(status)] || [catch { array set result [feed_parser::parse_feed -xml $f(page)] }] } {
+ if { "200" ne $f(status) || [catch { array set result [feed_parser::parse_feed -xml $f(page)] }] } {
ns_log Debug "news_aggregator::source::new: Couldn't httpget, status = $f(status)"
return 0
}
@@ -69,7 +69,7 @@
update -source_id $source_id -feed_url $feed_url -modified ""
- if { [exists_and_not_null aggregator_id] } {
+ if { ([info exists aggregator_id] && $aggregator_id ne "") } {
news_aggregator::subscription::new \
-aggregator_id $aggregator_id \
-source_id $source_id
@@ -103,13 +103,13 @@
{-domain:required}
{-description:required}
} {
- if { [exists_and_not_null guid] } {
+ if { ([info exists guid] && $guid ne "") } {
return guid
- } elseif { [exists_and_not_null link] && [news_aggregator::check_link \
+ } elseif { ([info exists link] && $link ne "") && [news_aggregator::check_link \
-link $link \
-domain $domain] } {
return link
- } elseif { [exists_and_not_null description] } {
+ } elseif { ([info exists description] && $description ne "") } {
return description
}
}
@@ -137,7 +137,7 @@
return
}
- if { ![string equal 200 $f(status)] } {
+ if { "200" ne $f(status) } {
ns_log Debug "source::update: httpget didn't return 200 but $f(status)"
return
}
@@ -221,8 +221,8 @@
}
if { (!$new_p
- && (![string equal $db_title $title] ||
- ![string equal $db_description $description]))
+ && ($db_title ne $title ||
+ $db_description ne $description ))
||
$new_p } {
set updated_p 1
@@ -277,7 +277,7 @@
Generate a private GUID for an entry that is used only
by news-aggregator.
} {
- if { ![exists_and_not_null guid] } {
+ if { (![info exists guid] || $guid eq "") } {
set message [list $title $link $description]
set guid [ns_sha1 $message]
}
@@ -309,7 +309,7 @@
set source_count [db_string source_count ""]
if { $source_count >= 1 } {
if { !$all_sources_p } {
- set limit [expr int($source_count/4)]
+ set limit [expr {int($source_count/4)}]
if { $limit < 1 } {
set limit 1
}
Index: openacs-4/packages/news-aggregator/tcl/weblog-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/news-aggregator/tcl/weblog-procs.tcl,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/news-aggregator/tcl/weblog-procs.tcl 20 Mar 2004 11:04:39 -0000 1.1
+++ openacs-4/packages/news-aggregator/tcl/weblog-procs.tcl 7 Apr 2018 16:58:52 -0000 1.2
@@ -22,13 +22,13 @@
@author Simon Carstensen (simon@bcuni.net)
@creation-date 2003-07-14
} {
- if { [empty_string_p $package_id]} {
+ if { $package_id eq ""} {
set package_id [ad_conn package_id]
}
- if { [empty_string_p $user_id]} {
+ if { $user_id eq ""} {
set user_id [ad_conn user_id]
}
- if { [empty_string_p $ip]} {
+ if { $ip eq ""} {
set ip [ns_conn peeraddr]
}
Index: openacs-4/packages/news-aggregator/www/aggregator-delete.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/news-aggregator/www/aggregator-delete.tcl,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/news-aggregator/www/aggregator-delete.tcl 20 Mar 2004 11:04:39 -0000 1.1
+++ openacs-4/packages/news-aggregator/www/aggregator-delete.tcl 7 Apr 2018 16:58:52 -0000 1.2
@@ -13,11 +13,11 @@
set user_id [ad_conn user_id]
set default_aggregator [db_string find_default {}]
-if { [string equal $delete_aggregator_id $default_aggregator] } {
+if {$delete_aggregator_id eq $default_aggregator} {
# We are deleting the user's default aggregator
# Set user's oldest aggregator as new default
set new_default_aggregator [db_string select_oldest_aggregator {} -default ""]
- if { [exists_and_not_null $new_default_aggregator] } {
+ if { ([info exists $new_default_aggregator] && $$new_default_aggregator ne "") } {
news_aggregator::aggregator::set_user_default \
-user_id $user_id \
-aggregator_id $new_default_aggregator
Index: openacs-4/packages/news-aggregator/www/aggregator.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/news-aggregator/www/aggregator.tcl,v
diff -u -r1.4 -r1.5
--- openacs-4/packages/news-aggregator/www/aggregator.tcl 1 Mar 2005 00:01:39 -0000 1.4
+++ openacs-4/packages/news-aggregator/www/aggregator.tcl 7 Apr 2018 16:58:52 -0000 1.5
@@ -45,7 +45,7 @@
-description $description \
-public_p $public_p
- if { [exists_and_not_null return_url] } {
+ if { ([info exists return_url] && $return_url ne "") } {
ad_returnredirect $return_url
} else {
ad_returnredirect settings
@@ -58,7 +58,7 @@
-description $description \
-public_p $public_p]
- if { [exists_and_not_null return_url] } {
+ if { ([info exists return_url] && $return_url ne "") } {
ad_returnredirect $return_url
} else {
ad_returnredirect "[ad_conn package_url]$new_aggregator_id"
Index: openacs-4/packages/news-aggregator/www/index.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/news-aggregator/www/index.tcl,v
diff -u -r1.10 -r1.11
--- openacs-4/packages/news-aggregator/www/index.tcl 7 Apr 2018 11:09:13 -0000 1.10
+++ openacs-4/packages/news-aggregator/www/index.tcl 7 Apr 2018 16:58:52 -0000 1.11
@@ -85,7 +85,7 @@
set create_url "${package_url}/aggregator"
set limit [parameter::get -parameter "number_of_items_shown"]
-set sql_limit [expr 7*$limit]
+set sql_limit [expr {7*$limit}]
set top 0
set bottom 1073741824
@@ -156,16 +156,16 @@
}
}
- if { [exists_and_not_null content_encoded] } {
- if { [exists_and_not_null item_title] } {
+ if { ([info exists content_encoded] && $content_encoded ne "") } {
+ if { ([info exists item_title] && $item_title ne "") } {
set content "$item_title. $content_encoded"
} else {
set content $content_encoded
}
} else {
set text_only [util_remove_html_tags $item_description]
- if { [exists_and_not_null item_title] } {
+ if { ([info exists item_title] && $item_title ne "") } {
set content "$item_title. $item_author
$item_description"
} else {
@@ -179,7 +179,7 @@
set item_guid_link $item_link
}
- set diff [news_aggregator::last_scanned -diff [expr [expr [clock seconds] - [clock scan $last_scanned]] / 60]]
+ set diff [news_aggregator::last_scanned -diff [expr [expr {[clock seconds] - [clock scan $last_scanned]}] / 60]]
set source_url [export_vars -base source {source_id}]
set technorati_url "http://www.technorati.com/cosmos/links.html?url=$link&sub=Get+Link+Cosmos"
@@ -191,7 +191,7 @@
set pub_date [clock format $localtime -format "%m-%d %H:%M"]
}
- if { [string equal $write_p "1"] } {
+ if {$write_p eq "1"} {
if { [lsearch $saved_items $item_id] == -1 } {
set save_url [export_vars -base "${url}item-save" {item_id}]
set unsave_url ""
@@ -213,7 +213,7 @@
}
if { $enable_purge_p &&
- [exists_and_not_null top] && [exists_and_not_null bottom] &&
+ ([info exists top] && $top ne "") && ([info exists bottom] && $bottom ne "") &&
$top >= $bottom && $public_p == "f" &&
[permission::permission_p -party_id $user_id -object_id $aggregator_id -privilege write] } {
Index: openacs-4/packages/news-aggregator/www/item-blog.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/news-aggregator/www/item-blog.tcl,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/news-aggregator/www/item-blog.tcl 20 Mar 2004 11:04:39 -0000 1.1
+++ openacs-4/packages/news-aggregator/www/item-blog.tcl 7 Apr 2018 16:58:52 -0000 1.2
@@ -12,12 +12,12 @@
db_1row select_item {}
-if { [exists_and_not_null content_encoded] } {
+if { ([info exists content_encoded] && $content_encoded ne "") } {
set content $content_encoded
} else {
set text_only [util_remove_html_tags $item_description]
- if {[exists_and_not_null item_title] && ![string equal -nocase $item_title $text_only] } {
+ if {([info exists item_title] && $item_title ne "") && ![string equal -nocase $item_title $text_only] } {
set content "$item_title. $item_description"
} else {
set content $item_description
@@ -49,7 +49,7 @@
db_1row select_weblog ""
- if { [exists_and_not_null content_encoded] } {
+ if { ([info exists content_encoded] && $content_encoded ne "") } {
set text $content_encoded
} else {
set text $item_description
Index: openacs-4/packages/news-aggregator/www/opml-import-2.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/news-aggregator/www/opml-import-2.tcl,v
diff -u -r1.2 -r1.3
--- openacs-4/packages/news-aggregator/www/opml-import-2.tcl 1 Mar 2005 00:01:39 -0000 1.2
+++ openacs-4/packages/news-aggregator/www/opml-import-2.tcl 7 Apr 2018 16:58:52 -0000 1.3
@@ -34,7 +34,7 @@
array set opml [news_aggregator::opml::parse -xml $f(page)]
- if { $opml(status) == "failure" } {
+ if { $opml(status) eq "failure" } {
error "OPML parse error: $opml(errmsg)"
}
Index: openacs-4/packages/news-aggregator/www/settings.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/news-aggregator/www/settings.tcl,v
diff -u -r1.2 -r1.3
--- openacs-4/packages/news-aggregator/www/settings.tcl 20 Jan 2018 23:00:54 -0000 1.2
+++ openacs-4/packages/news-aggregator/www/settings.tcl 7 Apr 2018 16:58:52 -0000 1.3
@@ -83,7 +83,7 @@
delete_onclick
default_p
} aggregators select_aggregators {} {
- if { [string equal $public_p t] } {
+ if {$public_p == "t"} {
set public_p "Yes"
} else {
set public_p "No"
@@ -94,7 +94,7 @@
set delete_url [export_vars -base aggregator-delete {{delete_aggregator_id $aggregator_id}}]
set delete_onclick "return confirm('Are you sure you want to delete this news aggregator?');"
- if { [string equal $aggregator_id $default_aggregator] } {
+ if {$aggregator_id eq $default_aggregator} {
set default_p 1
} else {
set default_p 0
Index: openacs-4/packages/news-aggregator/www/subscription-copy.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/news-aggregator/www/subscription-copy.tcl,v
diff -u -r1.2 -r1.3
--- openacs-4/packages/news-aggregator/www/subscription-copy.tcl 25 Jan 2005 23:17:09 -0000 1.2
+++ openacs-4/packages/news-aggregator/www/subscription-copy.tcl 7 Apr 2018 16:58:52 -0000 1.3
@@ -18,7 +18,7 @@
set package_id [ad_conn package_id]
set package_url [ad_conn package_url]
-if { [exists_and_not_null copy_to] } {
+if { ([info exists copy_to] && $copy_to ne "") } {
foreach source_id $source_ids {
news_aggregator::subscription::copy \
@@ -32,7 +32,7 @@
set aggregator_count [db_string count_aggregators {}]
-if { [string equal $aggregator_count "2"] } {
+if {$aggregator_count eq "2"} {
set copy_to [db_string select_aggregator_id {}]
foreach source $source_id {
Index: openacs-4/packages/news-aggregator/www/subscription-move.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/news-aggregator/www/subscription-move.tcl,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/news-aggregator/www/subscription-move.tcl 20 Mar 2004 11:04:39 -0000 1.1
+++ openacs-4/packages/news-aggregator/www/subscription-move.tcl 7 Apr 2018 16:58:52 -0000 1.2
@@ -18,7 +18,7 @@
set package_id [ad_conn package_id]
set package_url [ad_conn package_url]
-if { [exists_and_not_null move_to] } {
+if { ([info exists move_to] && $move_to ne "") } {
foreach source_id $source_ids {
news_aggregator::subscription::move \
@@ -33,7 +33,7 @@
set aggregator_count [db_string count_aggregators {}]
-if { [string equal $aggregator_count "2"] } {
+if {$aggregator_count eq "2"} {
set move_to [db_string select_aggregator_id {}]
foreach source $source_id {
Index: openacs-4/packages/news-aggregator/www/subscriptions.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/news-aggregator/www/subscriptions.tcl,v
diff -u -r1.8 -r1.9
--- openacs-4/packages/news-aggregator/www/subscriptions.tcl 7 Apr 2018 11:09:13 -0000 1.8
+++ openacs-4/packages/news-aggregator/www/subscriptions.tcl 7 Apr 2018 16:58:52 -0000 1.9
@@ -26,7 +26,7 @@
# This is done in case we want to implement some user interface
# stuff in the future where it might be useful.
-if { [empty_string_p $feed_url] } {
+if { $feed_url eq "" } {
set feed_url_val ""
} else {
set feed_url_val $feed_url
@@ -35,7 +35,7 @@
#ad_returnredirect "[ad_conn package_url]opml/$aggregator_id/mySubscriptions.opml"
#ad_script_abort
-if { [exists_and_not_null source_id] } {
+if { ([info exists source_id] && $source_id ne "") } {
set delete_count 0
foreach delete_id $source_id {
news_aggregator::subscription::delete \
@@ -144,7 +144,7 @@
}
} -validate {
{feed_url
- { [exists_and_not_null feed_url] && ![string equal "http://" $feed_url] }
+ { ([info exists feed_url] && $feed_url ne "") && "http://" ne $feed_url }
{ You must specify a URL }
}
} -new_data {