- Timestamp:
- Oct 14, 2007 7:19:17 AM (17 years ago)
- Location:
- trunk/lib
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/App.inc.php
r260 r282 616 616 617 617 /** 618 * Sets which query arguments will be carried persistently between requests. 618 * Forcefully set a query argument even if one currently exists in the reqeust. 619 * Values in the _carry_queries array will be copied to URLs (via $app->url()) and 620 * to hidden input values (via printHiddenSession()). 621 * 622 * @access public 623 * @param mixed $query_key The key (or keys, as an array) of the query argument to save. 624 * @param mixed $val The new value of the argument key. 625 * @author Quinn Comendant <quinn@strangecode.com> 626 * @since 13 Oct 2007 11:34:51 627 */ 628 function setQuery($query_key, $val) 629 { 630 if (!is_array($query_key)) { 631 $query_key = array($query_key); 632 } 633 foreach ($query_key as $k) { 634 // Set the value of the specified query argument into the _carry_queries array. 635 $this->_carry_queries[$k] = $val; 636 } 637 } 638 639 /** 640 * Specify which query arguments will be carried persistently between requests. 619 641 * Values in the _carry_queries array will be copied to URLs (via $app->url()) and 620 642 * to hidden input values (via printHiddenSession()). -
trunk/lib/Email.inc.php
r247 r282 233 233 { 234 234 $app =& App::getInstance(); 235 235 236 236 // Use arguments if provided. 237 237 if (isset($to)) { -
trunk/lib/FormValidator.inc.php
r279 r282 521 521 return true; 522 522 } else { 523 $this->addError($form_name, sprintf(_(" <em>%s</em> is not a valid credit card number."), $cc_num));523 $this->addError($form_name, sprintf(_("The credit card number you entered is not valid. Please check the number and try again."), $cc_num)); 524 524 return false; 525 525 } -
trunk/lib/Utilities.inc.php
r264 r282 708 708 * @param string $val The string to sign. 709 709 * @param string $salt (Optional) A text key to use for computing the signature. 710 * @param string $length (Optional) The length of the added signature. Longer signatures are safer. Must match the length passed to verifySignature() for the signatures to match. 710 711 * @return string The original value with a signature appended. 711 712 */ 712 function addSignature($val, $salt=null )713 function addSignature($val, $salt=null, $length=18) 713 714 { 714 715 $app =& App::getInstance(); … … 723 724 } 724 725 725 return $val . '-' . mb_substr(md5($salt . md5($val . $salt)), 0, 18);726 return $val . '-' . mb_substr(md5($salt . md5($val . $salt)), 0, $length); 726 727 } 727 728 … … 750 751 * @return bool True if the signature matches the var. 751 752 */ 752 function verifySignature($signed_val, $salt=null )753 function verifySignature($signed_val, $salt=null, $length=18) 753 754 { 754 755 // Strip the value from the signed value. 755 756 $val = removeSignature($signed_val); 756 757 // If the signed value matches the original signed value we consider the value safe. 757 if ($signed_val == addSignature($val, $salt )) {758 if ($signed_val == addSignature($val, $salt, $length)) { 758 759 // Signature verified. 759 760 return true;
Note: See TracChangeset
for help on using the changeset viewer.