Project

General

Profile

« Previous | Next » 

Revision 792

Added by doc about 16 years ago

added handling of missing characters to mailto encryption routines

View differences:

filter-routines.php
167 167
				// encrypt the email using an adapted Caesar cipher
168 168
		  	$encrypted_email = "";
169 169
				for($i = strlen($email_address) -1; $i > -1; $i--) {
170
					if(in_array($email_address[$i], array('F', 'Z', 'X', 'K'))) {
170
					if(preg_match('#[FZXK0-9]#', $email_address[$i], $characters)) {
171 171
						$encrypted_email .= $email_address[$i];
172 172
					} else {
173 173
						$encrypted_email .= chr((ord($email_address[$i]) -97 + $shift) % 26 + 97);

Also available in: Unified diff