Changeset 609

Show
Ignore:
Timestamp:
10/06/07 09:54:24 (1 year ago)
Author:
laurentj
Message:

fixed bug #297: bad regular expression to check mail string in jforms.js and jFilter

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/1.0beta3.x/lib/jelix-www/js/jforms.js

    r540 r609  
    185185                        break;*/ 
    186186                    case 'email' : 
    187                         ok = (val.search(/^[A-Z0-9][A-Z0-9_\-]*(\.[A-Z0-9][A-Z0-9_\-]*)*@[A-Z0-9][A-Z0-9_\-]*(\.[A-Z0-9][A-Z0-9_\-]+)$/i) != -1) 
     187                        ok = (val.search(/^[A-Z0-9][A-Z0-9_\-]*(\.[A-Z0-9][A-Z0-9_\-]*)*@[A-Z0-9][A-Z0-9_\-]*(\.[A-Z0-9][A-Z0-9_\-]+)+$/i) != -1) 
    188188                        break; 
    189189                    case 'ipv4' : 
  • branches/1.0beta3.x/lib/jelix-www/js/jforms.js

    r540 r609  
    185185                        break;*/ 
    186186                    case 'email' : 
    187                         ok = (val.search(/^[A-Z0-9][A-Z0-9_\-]*(\.[A-Z0-9][A-Z0-9_\-]*)*@[A-Z0-9][A-Z0-9_\-]*(\.[A-Z0-9][A-Z0-9_\-]+)$/i) != -1) 
     187                        ok = (val.search(/^[A-Z0-9][A-Z0-9_\-]*(\.[A-Z0-9][A-Z0-9_\-]*)*@[A-Z0-9][A-Z0-9_\-]*(\.[A-Z0-9][A-Z0-9_\-]+)+$/i) != -1) 
    188188                        break; 
    189189                    case 'ipv4' : 
  • branches/1.0beta3.x/lib/jelix/utils/jFilter.class.php

    r408 r609  
    175175        return filter_var($val, FILTER_VALIDATE_EMAIL); 
    176176#else 
    177         return preg_match('/^[A-Z0-9][A-Z0-9_\-]*(\.[A-Z0-9][A-Z0-9_\-]*)*@[A-Z0-9][A-Z0-9_\-]*(\.[A-Z0-9][A-Z0-9_\-]+)$/i',$val); 
     177        return preg_match('/^[A-Z0-9][A-Z0-9_\-]*(\.[A-Z0-9][A-Z0-9_\-]*)*@[A-Z0-9][A-Z0-9_\-]*(\.[A-Z0-9][A-Z0-9_\-]+)+$/i',$val); 
    178178#endif 
    179179    } 
  • branches/1.0beta3.x/lib/jelix/utils/jFilter.class.php

    r408 r609  
    175175        return filter_var($val, FILTER_VALIDATE_EMAIL); 
    176176#else 
    177         return preg_match('/^[A-Z0-9][A-Z0-9_\-]*(\.[A-Z0-9][A-Z0-9_\-]*)*@[A-Z0-9][A-Z0-9_\-]*(\.[A-Z0-9][A-Z0-9_\-]+)$/i',$val); 
     177        return preg_match('/^[A-Z0-9][A-Z0-9_\-]*(\.[A-Z0-9][A-Z0-9_\-]*)*@[A-Z0-9][A-Z0-9_\-]*(\.[A-Z0-9][A-Z0-9_\-]+)+$/i',$val); 
    178178#endif 
    179179    } 
  • branches/1.0beta3.x/testapp/modules/jelix_tests/tests/jforms.htmlbuilder.html.php

    r605 r609  
    8383<input type="hidden" name="action" value="urlsig_url1"/> 
    8484</div><script type="text/javascript">  
    85 //<[CDATA[ 
     85//<![CDATA[ 
    8686 
    8787//]]> 
     
    9898<input type="hidden" name="action" value="urlsig_url1"/> 
    9999</div><script type="text/javascript">  
    100 //<[CDATA[ 
     100//<![CDATA[ 
    101101 
    102102//]]> 
  • branches/1.0beta3.x/testapp/modules/jelix_tests/tests/jforms.htmlbuilder.html.php

    r605 r609  
    8383<input type="hidden" name="action" value="urlsig_url1"/> 
    8484</div><script type="text/javascript">  
    85 //<[CDATA[ 
     85//<![CDATA[ 
    8686 
    8787//]]> 
     
    9898<input type="hidden" name="action" value="urlsig_url1"/> 
    9999</div><script type="text/javascript">  
    100 //<[CDATA[ 
     100//<![CDATA[ 
    101101 
    102102//]]> 
  • branches/1.0beta3.x/testapp/modules/testapp/forms/sample.form.xml

    r605 r609  
    88   <input ref="prenom" defaultvalue="robert"> 
    99      <label>Votre prénom</label> 
     10   </input> 
     11 
     12   <input ref="mail" type="email"> 
     13      <label>Votre mail</label> 
    1014   </input> 
    1115 
  • branches/1.0beta3.x/testapp/modules/testapp/forms/sample.form.xml

    r605 r609  
    88   <input ref="prenom" defaultvalue="robert"> 
    99      <label>Votre prénom</label> 
     10   </input> 
     11 
     12   <input ref="mail" type="email"> 
     13      <label>Votre mail</label> 
    1014   </input> 
    1115 
  • trunk/lib/jelix-www/js/jforms.js

    r540 r609  
    185185                        break;*/ 
    186186                    case 'email' : 
    187                         ok = (val.search(/^[A-Z0-9][A-Z0-9_\-]*(\.[A-Z0-9][A-Z0-9_\-]*)*@[A-Z0-9][A-Z0-9_\-]*(\.[A-Z0-9][A-Z0-9_\-]+)$/i) != -1) 
     187                        ok = (val.search(/^[A-Z0-9][A-Z0-9_\-]*(\.[A-Z0-9][A-Z0-9_\-]*)*@[A-Z0-9][A-Z0-9_\-]*(\.[A-Z0-9][A-Z0-9_\-]+)+$/i) != -1) 
    188188                        break; 
    189189                    case 'ipv4' : 
  • trunk/lib/jelix-www/js/jforms.js

    r540 r609  
    185185                        break;*/ 
    186186                    case 'email' : 
    187                         ok = (val.search(/^[A-Z0-9][A-Z0-9_\-]*(\.[A-Z0-9][A-Z0-9_\-]*)*@[A-Z0-9][A-Z0-9_\-]*(\.[A-Z0-9][A-Z0-9_\-]+)$/i) != -1) 
     187                        ok = (val.search(/^[A-Z0-9][A-Z0-9_\-]*(\.[A-Z0-9][A-Z0-9_\-]*)*@[A-Z0-9][A-Z0-9_\-]*(\.[A-Z0-9][A-Z0-9_\-]+)+$/i) != -1) 
    188188                        break; 
    189189                    case 'ipv4' : 
  • trunk/lib/jelix/utils/jFilter.class.php

    r408 r609  
    175175        return filter_var($val, FILTER_VALIDATE_EMAIL); 
    176176#else 
    177         return preg_match('/^[A-Z0-9][A-Z0-9_\-]*(\.[A-Z0-9][A-Z0-9_\-]*)*@[A-Z0-9][A-Z0-9_\-]*(\.[A-Z0-9][A-Z0-9_\-]+)$/i',$val); 
     177        return preg_match('/^[A-Z0-9][A-Z0-9_\-]*(\.[A-Z0-9][A-Z0-9_\-]*)*@[A-Z0-9][A-Z0-9_\-]*(\.[A-Z0-9][A-Z0-9_\-]+)+$/i',$val); 
    178178#endif 
    179179    } 
  • trunk/lib/jelix/utils/jFilter.class.php

    r408 r609  
    175175        return filter_var($val, FILTER_VALIDATE_EMAIL); 
    176176#else 
    177         return preg_match('/^[A-Z0-9][A-Z0-9_\-]*(\.[A-Z0-9][A-Z0-9_\-]*)*@[A-Z0-9][A-Z0-9_\-]*(\.[A-Z0-9][A-Z0-9_\-]+)$/i',$val); 
     177        return preg_match('/^[A-Z0-9][A-Z0-9_\-]*(\.[A-Z0-9][A-Z0-9_\-]*)*@[A-Z0-9][A-Z0-9_\-]*(\.[A-Z0-9][A-Z0-9_\-]+)+$/i',$val); 
    178178#endif 
    179179    } 
  • trunk/testapp/modules/testapp/forms/sample.form.xml

    r605 r609  
    88   <input ref="prenom" defaultvalue="robert"> 
    99      <label>Votre prénom</label> 
     10   </input> 
     11 
     12   <input ref="mail" type="email"> 
     13      <label>Votre mail</label> 
    1014   </input> 
    1115 
  • trunk/testapp/modules/testapp/forms/sample.form.xml

    r605 r609  
    88   <input ref="prenom" defaultvalue="robert"> 
    99      <label>Votre prénom</label> 
     10   </input> 
     11 
     12   <input ref="mail" type="email"> 
     13      <label>Votre mail</label> 
    1014   </input> 
    1115 
Download in other formats: Unified Diff Zip Archive