Changeset 308
- Timestamp:
- Jan 30, 2008 9:33:49 AM (16 years ago)
- Location:
- branches/1.1dev
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/1.1dev/css/admin.inc.css
r289 r308 44 44 /* The following are here in addition to in utilities.inc.css only because I want the font size 70%. Is there a more general way to do this? There currently are NO font-size specifications in utilities.inc.css or codebase.inc.css. That seems safest, but requires that they are redefined anyways (like here for eg). Have you figured out how to do font sizes correctly? */ 45 45 46 form label 46 form label, 47 form legend 47 48 { 48 49 font-size: 70%; … … 50 51 /* BEAU: I added class="right" to the <TD> to make them align right as they were before. Do you know a better way? */ 51 52 /*float: right;*/ 53 } 54 form fieldset 55 { 56 border: 1px solid #ddd; 57 margin: 0; 58 padding: 0.5em 0 0.5em 0.5em; 52 59 } 53 60 form .formtext label -
branches/1.1dev/css/utilities.inc.css
r306 r308 171 171 font-weight: normal; 172 172 } 173 174 .normal { font-weight: normal; } -
branches/1.1dev/lib/App.inc.php
r225 r308 693 693 } 694 694 } 695 return $dolookup ? gethostbyaddr($ip) : $ip;695 return $dolookup && '' != $ip ? gethostbyaddr($ip) : $ip; 696 696 } 697 697 -
branches/1.1dev/lib/FormValidator.inc.php
r140 r308 347 347 * 348 348 * @param string $form_name The name of the incoming form variable 349 * @param boolean $allow_fullname Allow the use of rfc822 expanded email address with comment: Quinn Commie <quinn@strangecode.com>350 349 * 351 350 * @return bool true if no errors found, false otherwise 352 351 */ 353 function validateEmail($form_name , $allow_fullname=false)354 { 352 function validateEmail($form_name) 353 { 355 354 $email = getFormData($form_name); 356 355 if ('' == trim($email)) { … … 358 357 } 359 358 359 $regex = '/^(?:[^,@]*\s+|[^,@]*(<)|)' // Display name 360 . '((?:[^.<>\s@\",\[\]]+[^<>\s@\",\[\]])*[^.<>\s@\",\[\]]+)' // Local-part 361 . '@' // @ 362 . '((?:(\[)|[A-Z0-9]?)' // Domain, first char 363 . '(?(4)' // Domain conditional for if first domain char is [ 364 . '(?:[0-9]{1,3}\.){3}[0-9]{1,3}\]' // TRUE, matches IP address 365 . '|' 366 . '[.-]?(?:[A-Z0-9]+[-.])*(?:[A-Z0-9]+\.)+[A-Z]{2,6}))' // FALSE, matches domain name 367 . '(?(1)' // Comment conditional for if initial < exists 368 . '(?:>\s*|>\s+\([^,@]+\)\s*)' // TRUE, ensure ending > 369 . '|' 370 . '(?:|\s*|\s+\([^,@]+\)\s*))$/i'; 371 360 372 // Test email address format. 361 if ($allow_fullname) { 362 if (!$this->checkRegex($form_name, '/^[\w\s]*<?php[A-Za-z0-9._-]{1,}\@[A-Za-z0-9.-]{1,}\.[A-Za-z]{2,5}>?$/i', true, sprintf(_("<strong>%s</strong> is not a valid email address."), $email))) { 363 logMsg(sprintf('The email address %s is not valid.', getFormData($form_name)), LOG_DEBUG, __FILE__, __LINE__); 364 return false; 365 } 366 } else { 367 if (!$this->checkRegex($form_name, '/^[A-Za-z0-9._-]{1,}\@[A-Za-z0-9.-]{1,}\.[A-Za-z]{2,5}$/i', true, sprintf(_("<strong>%s</strong> is not a valid email address."), $email))) { 368 logMsg(sprintf('The email address %s is not valid.', getFormData($form_name)), LOG_DEBUG, __FILE__, __LINE__); 369 return false; 370 } 371 } 373 if (!preg_match($regex, getFormData($form_name), $e_parts)) { 374 $this->addError($form_name, sprintf(_("The email address <strong>%s</strong> is formatted incorrectly."), oTxt(getFormData($form_name))), MSG_ERR, __FILE__, __LINE__); 375 logMsg(sprintf('The email address %s is not valid.', getFormData($form_name)), LOG_DEBUG, __FILE__, __LINE__); 376 return false; 377 } 378 379 // We have a match! Here are the captured subpatterns, on which further tests are run. 380 // The part before the @. 381 $local = $e_parts[2]; 382 383 // The part after the @. 384 // If domain is an IP [XXX.XXX.XXX.XXX] strip off the brackets. 385 $domain = $e_parts[3]{0} == '[' ? mb_substr($e_parts[3], 1, -1) : $e_parts[3]; 372 386 373 387 // Test length. 374 if (!$this->stringLength($form_name, 0, 128, sprintf(_("<strong>Email address</strong> must contain less than 128 characters."), $email))) { 375 logMsg(sprintf('The email address %s must contain less than 128 characters.', getFormData($form_name)), LOG_DEBUG, __FILE__, __LINE__); 376 return false; 377 } 378 379 // Check domain exists and has valid MX record. 380 preg_match('/^[\w\s]*<?php[A-Za-z0-9._-]{1,}\@([A-Za-z0-9.-]{1,}\.[A-Za-z]{2,5})>?$/i', $email, $matches); 381 if (!empty($matches[1])) { 382 if (!checkdnsrr($matches[1] . '.', 'MX') && gethostbyname($matches[1]) == $matches[1]) { 383 $this->addError($form_name, sprintf(_("<strong>%s</strong> is not a valid email domain name"), $matches[1])); 384 logMsg(sprintf('The email address %s contains an invalid email domain name (%s).', getFormData($form_name), $matches[1]), LOG_DEBUG, __FILE__, __LINE__); 385 return false; 386 } 388 if (mb_strlen($local) > 64 || mb_strlen($domain) > 191) { 389 $this->addError($form_name, sprintf(_("The email address <strong>%s</strong> is too long."), oTxt(getFormData($form_name))), MSG_ERR, __FILE__, __LINE__); 390 logMsg(sprintf('The email address %s is too long.', getFormData($form_name)), LOG_DEBUG, __FILE__, __LINE__); 391 return false; 392 } 393 394 // Check domain exists: It's a domain if ip2long fails; Checkdnsrr ensures a MX record exists; Gethostbyname() ensures the domain exists. 395 // Compare ip2long twice for php4 backwards compat. 396 if ((ip2long($domain) == '-1' || ip2long($domain) === false) && function_exists('checkdnsrr') && !checkdnsrr($domain . '.', 'MX') && gethostbyname($domain) == $domain) { 397 $this->addError($form_name, sprintf(_("The email address <em>%s</em> does not have a valid domain name."), oTxt(getFormData($form_name))), MSG_ERR, __FILE__, __LINE__); 398 logMsg(sprintf('The email address %s does not have a valid domain name.', getFormData($form_name)), LOG_DEBUG, __FILE__, __LINE__); 399 return false; 387 400 } 388 401 -
branches/1.1dev/lib/TemplateGlue.inc.php
r289 r308 169 169 if ('allone' == $flag) { 170 170 // Print a cell with multidimentioal array checkboxes. 171 ?><td><label ><input type="checkbox" name="dbcol[<?php echo $db_col; ?>][<?php echo $item; ?>]"<?php echo $checked; ?> /> <?php echo oTxt($item); ?></label> </td>171 ?><td><label class="normal"><input type="checkbox" name="dbcol[<?php echo $db_col; ?>][<?php echo $item; ?>]"<?php echo $checked; ?> /> <?php echo oTxt($item); ?></label> </td> 172 172 <?php 173 173 } else { 174 174 // Print a cell with basic named checkboxes. 175 ?><td><label ><input type="checkbox" name="<?php echo $db_col; ?>[<?php echo $item; ?>]"<?php echo $checked; ?> /> <?php echo oTxt($item); ?></label> </td>175 ?><td><label class="normal"><input type="checkbox" name="<?php echo $db_col; ?>[<?php echo $item; ?>]"<?php echo $checked; ?> /> <?php echo oTxt($item); ?></label> </td> 176 176 <?php 177 177 } … … 248 248 } 249 249 // Print a cell with basic named checkboxes. 250 ?><td><label ><input type="radio" name="<?php echo $db_col; ?>" value="<?php echo $item ?>"<?php echo $checked; ?> /> <?php echo oTxt($item); ?></label> </td>250 ?><td><label class="normal"><input type="radio" name="<?php echo $db_col; ?>" value="<?php echo $item ?>"<?php echo $checked; ?> /> <?php echo oTxt($item); ?></label> </td> 251 251 <?php 252 252 }
Note: See TracChangeset
for help on using the changeset viewer.