On a wiki I maintain, I find that people enter "spam hardened" (supposedly) email addresses, like asheesh AT creativecommons DOT org. I figured it would be nice to show those, even if they're not really email addresses.

It was easy to comment out the validator, but that's not what this email is about: I propose (with a patch, attached) that SMW always urlencode() email addresses when generating their URIs and URLs.

This is always a safe thing to do, and it may in some cases (as for me) be a crucial correctness issue. Hopefully you'll apply this.

-- Asheesh.

--
A penny saved kills your career in government.
Index: includes/SMW_DV_URI.php
===================================================================
--- includes/SMW_DV_URI.php	(revision 27131)
+++ includes/SMW_DV_URI.php	(working copy)
@@ -88,8 +88,8 @@
 						break;
 					}
 					$this->m_value = $value;
-					$this->m_url = 'mailto:' . $value;
-					$this->m_uri = 'mailto:' . $value;
+					$this->m_url = 'mailto:' . urlencode($value);
+					$this->m_uri = 'mailto:' . urlencode($value);
 			}
 		} else {
 			$this->addError(wfMsgForContent('smw_emptystring'));
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Semediawiki-devel mailing list
Semediawiki-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/semediawiki-devel

Reply via email to