Skip to content

Commit

Permalink
Minor cleanup to some code in installation/upgrade which refused to a…
Browse files Browse the repository at this point in the history
…ccept valid email address...changed expValidator code to use same routine as other email checking methods.

Fixed installation create administrator failure to go back to install-7 instead of old create admin file.
Simplified install/upgrade check in exponent.php
  • Loading branch information
dleffler committed Jul 9, 2011
1 parent 8d5ec8f commit 84108dd
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
3 changes: 3 additions & 0 deletions framework/core/subsystems/expValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -447,6 +447,9 @@ public static function flashAndReturnToForm($queue='message', $msg, $post=null)
* @return bool
*/
public static function validate_email_address($email) {
return expValidator::isValidEmail($email);

// old code
// First, we check that there's one @ symbol, and that the lengths are right
// if (!ereg("^[^@]{1,64}@[^@]{1,255}$", $email)) {
if (!preg_match("^[^@]{1,64}@[^@]{1,255}$", $email)) {
Expand Down
7 changes: 1 addition & 6 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,7 @@ function epb($buffer, $mode) {
//exponent_users_login("anonymous", "anonymous");
}

if (@file_exists(BASE.'install/not_configured')) {
header('Location: '.URL_FULL.'install/index.php');
exit('Redirecting to the Exponent Install Wizard');
}

if (!(file_exists(BASE.'conf/config.php'))) {
if (@file_exists(BASE.'install/not_configured') || !(file_exists(BASE.'conf/config.php'))) {
header('Location: '.URL_FULL.'install/index.php');
exit('Redirecting to the Exponent Install Wizard');
}
Expand Down
2 changes: 1 addition & 1 deletion install/pages/install-7.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
} else {
if (expValidator::validate_email_address($_POST['email']) == false) {
flash('You must supply a valid email address.');
header('Location: index.php?page=admin_user&erremail=true');
header('Location: index.php?page=install-6&erremail=true');
exit();
}
$user->password = md5($_POST['password']);
Expand Down

0 comments on commit 84108dd

Please sign in to comment.