--- modules/technorati/technorati.module 2007-04-29 06:03:07.000000000 +0000
+++ modules/technorati/technoratiNew.module 2007-04-29 06:04:47.000000000 +0000
@@ -242,7 +242,17 @@ function _technorati_taxonomy($node) {
}
function _technorati_link($tag) {
- return '' . check_plain($tag) . '';
+ // Patch by Ron D. Fredericks (RDF), April 22, 2007
+ // http://www.embeddedcomponents.com/blogs/
+ // a) remove whitespace between tags;
+ // b) format the n words making up multi-word tags
+ // with (n-1) "+" symbols.
+ $tag = check_plain($tag);
+ $tag = str_replace("+", " ", $tag);
+ $tag = _technorati_wsstrip($tag);
+ return '' . $tag . '';
}
function technorati_ping($name = '', $url = '') {
@@ -254,3 +264,14 @@ function technorati_ping($name = '', $ur
watchdog('directory ping', t('Failed to notify technorati.com site.'), WATCHDOG_WARNING);
}
}
+
+function _technorati_wsstrip($str) {
+// Whitespace strip algorithm:
+// a) Delete all whitespace from left and/or right of tags,
+// b) Reduce multiple whitespace in between elements of tags
+// to a single whitespace.
+// Reference:
+// daggillies's comment on http://www.php.net/trim
+ $str=ereg_replace (' +', ' ', trim($str));
+ return ereg_replace("[\r\t\n]","",$str);
+}