Changeset 15648


Ignore:
Timestamp:
Jun 12, 2012, 1:27:14 PM (12 years ago)
Author:
mistic100
Message:

check email validity before subscribe

Location:
extensions/Subscribe_to_comments
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • extensions/Subscribe_to_comments/include/functions.inc.php

    r15641 r15648  
    157157 
    158158  // check email
     159  if ( !empty($email) and !is_valid_email($email) )
     160  {
     161    array_push($page['errors'], l10n('mail address must be like xxx@yyy.eee (example : jack@altern.org)'));
     162    return false;
     163  }
    159164  if ( ( is_a_guest() or empty($user['email']) ) and empty($email) )
    160165  {
     
    679684
    680685/**
     686 * check if mail adress is valid
     687 * @param: string email
     688 * @return: bool
     689 */
     690function is_valid_email($mail_address)
     691{
     692  if (version_compare(PHP_VERSION, '5.2.0') >= 0)
     693  {
     694    return filter_var($mail_address, FILTER_VALIDATE_EMAIL)!==false;
     695  }
     696  else
     697  {
     698    $atom   = '[-a-z0-9!#$%&\'*+\\/=?^_`{|}~]';   // before  arobase
     699    $domain = '([a-z0-9]([-a-z0-9]*[a-z0-9]+)?)'; // domain name
     700    $regex = '/^' . $atom . '+' . '(\.' . $atom . '+)*' . '@' . '(' . $domain . '{1,63}\.)+' . $domain . '{2,63}$/i';
     701
     702    if (!preg_match($regex, $mail_address)) return false;
     703    return true;
     704  }
     705}
     706
     707
     708/**
    681709 * crypt a string using mcrypt extension or
    682710 * http://stackoverflow.com/questions/800922/how-to-encrypt-string-without-mcrypt-library-in-php/802957#802957
  • extensions/Subscribe_to_comments/language/en_UK/plugin.lang.php

    r15643 r15648  
    3535
    3636/* buttons */
    37 $lang['Manage my subscribtions'] = 'Manage my subscribtions';
     37$lang['Manage my subscriptions'] = 'Manage my subscriptions';
    3838$lang['Subscribe'] = 'Subscribe';
    3939$lang['Unsubscribe'] = 'Unsubscribe';
  • extensions/Subscribe_to_comments/language/fr_FR/plugin.lang.php

    r15644 r15648  
    2121$lang['Confirm your subscribtion to comments'] = 'Confirmez votre inscription aux commentaires';
    2222$lang['Followed on'] = 'Inscrit depuis';
    23 $lang['Manage my subscribtions'] = 'Gérer mes suivis';
     23$lang['Manage my subscriptions'] = 'Gérer mes suivis';
    2424$lang['New subscription on'] = 'Nouveau suivi sur';
    2525$lang['Not found.'] = 'Non trouvé.';
  • extensions/Subscribe_to_comments/template/form_standalone.tpl

    r15641 r15648  
    55  {if $SUBSCRIBED_ALL_IMAGES}
    66    {'You are currently subscribed to comments on'|@translate} {'all pictures of the gallery'|@translate}.
    7     <a href="{$MANAGE_LINK}">{'Manage my subscribtions'|@translate}</a>
     7    <a href="{$MANAGE_LINK}">{'Manage my subscriptions'|@translate}</a>
    88   
    99  {elseif $SUBSCRIBED_ALBUM_IMAGES}
     
    1717  {elseif $SUBSCRIBED_ALL_ALBUMS}
    1818    {'You are currently subscribed to comments on'|@translate} {'all albums of the gallery'|@translate}.
    19     <a href="{$MANAGE_LINK}">{'Manage my subscribtions'|@translate}</a>
     19    <a href="{$MANAGE_LINK}">{'Manage my subscriptions'|@translate}</a>
    2020   
    2121  {elseif $SUBSCRIBED_ALBUM}
  • extensions/Subscribe_to_comments/template/mail/confirm.tpl

    r15641 r15648  
    1515<p><a href="{$STC.VALIDATE_URL}" class="button">{'Confirm subscription'|@translate}</a></p>
    1616
    17 <p>{'Want to edit your notifications options?'|@translate} <a href="{$STC.MANAGE_URL}">{'Manage my subscribtions'|@translate}</a>.</p>
     17<p>{'Want to edit your notifications options?'|@translate} <a href="{$STC.MANAGE_URL}">{'Manage my subscriptions'|@translate}</a>.</p>
    1818
    1919</div>
  • extensions/Subscribe_to_comments/template/mail/notification.tpl

    r15641 r15648  
    1717<p>
    1818  <a href="{$STC.UNSUB_URL}">{'Stop receiving notifications'|@translate}</a><br>
    19   <a href="{$STC.MANAGE_URL}">{'Manage my subscribtions'|@translate}</a>
     19  <a href="{$STC.MANAGE_URL}">{'Manage my subscriptions'|@translate}</a>
    2020</p>
    2121
  • extensions/Subscribe_to_comments/template/subscribtions_page.tpl

    r15642 r15648  
    1818<p>
    1919  {if !empty($element)}<a href="{$element.url}" title="{$element.name}">{'Return to item page'|@translate}</a><br>{/if}
    20   <a href="{$MANAGE_LINK}">{'Manage my subscriptions to comments'|@translate}</a>
     20  <a href="{$MANAGE_LINK}">{'Manage my subscriptions'|@translate}</a>
    2121</p>
    2222{/if}
Note: See TracChangeset for help on using the changeset viewer.