Skip to content

Commit

Permalink
Removed filter_var(), because of issues on stupid hostings. Fixed #36.
Browse files Browse the repository at this point in the history
  • Loading branch information
bezumkin committed May 12, 2013
1 parent a9fa2a6 commit a4468c6
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions core/components/minishop2/docs/changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Changelog for miniShop2.
==============
- Fixed quick fields in snippet msOrder. Update your chunks for delivery and payment methods.
- Improved "totalVar" placeholder in snippet msGallery.
- [#36] Removed filter_var(), because of issues on stupid hostings.

2.0.0 pl3
==============
Expand Down
4 changes: 2 additions & 2 deletions core/components/minishop2/model/minishop2/minishop2.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ public function changeOrderStatus($order_id, $status_id) {
$emails = array_map('trim', explode(',', $this->modx->getOption('ms2_email_manager', null, $this->modx->getOption('emailsender'))));
if (!empty($subject)) {
foreach ($emails as $email) {
if (filter_var($email, FILTER_VALIDATE_EMAIL)) {
if (preg_match('/.+@.+..+/i', $email)) {
$this->sendEmail($email, $subject, $body);
}
}
Expand All @@ -288,7 +288,7 @@ public function changeOrderStatus($order_id, $status_id) {
$body = $this->processTags($chunk->process($pls));
}
$email = $profile->get('email');
if (!empty($subject) && filter_var($email, FILTER_VALIDATE_EMAIL)) {
if (!empty($subject) && preg_match('/.+@.+..+/i', $email)) {
$this->sendEmail($email, $subject, $body);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ public function validate($key, $value) {
$value = preg_replace('/\s+/',' ', trim($value));
}
switch ($key) {
case 'email': $value = filter_var($value, FILTER_VALIDATE_EMAIL) ? $value : @$this->order[$key]; break;
case 'email': $value = preg_match('/.+@.+..+/i', $value) ? $value : @$this->order[$key]; break;
case 'receiver':
$value = preg_replace('/[^a-zа-я\s]/iu','',$value);
$tmp = explode(' ',$value);
Expand Down

0 comments on commit a4468c6

Please sign in to comment.