You found a bug! We've classified it as EXTJS-7566 . We encourage you to continue the discussion and to find an acceptable workaround while we work on a permanent fix.
  1. #1
    Sencha User
    Join Date
    Oct 2012
    Posts
    6
    Vote Rating
    0
    keithrz is on a distinguished road

      0  

    Default URL vtype should not allow spaces

    URL vtype should not allow spaces


    Using ExtJS 4.1.1

    The url vtype thinks the following URL is valid:
    http://www.grammar school.com

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    36,754
    Vote Rating
    828
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    Thanks for the report! I have opened a bug in our bug tracker.

  3. #3
    Sencha User
    Join Date
    Oct 2012
    Posts
    6
    Vote Rating
    0
    keithrz is on a distinguished road

      0  

    Default


    The interesting thing here is that the regex for urls does not allow spaces. But Javascript's test() method for regex returns true if is testing a string that contains substrings that match the regex (and those substrings are only separated by whitespace.)


    http://www.grammar school.com


    returns true because the following strings match the regex:
    ['http://www.grammar', 'school.com']


    Here is my workaround: use the same regex, but use exec() instead of test(). The url regex is the same - it is copied because I did not have scope access to the original regex in the VType closure.


    Code:
    Ext.override(Ext.form.field.VTypes, {
        urlRegex: /(((^https?)|(^ftp)):\/\/((([\-\w]+\.)+\w{2,3}(\/[%\-\w]+(\.\w{2,})?)*(([\w\-\.\?\\\/+@&#;`~=%!]*)(\.\w{2,})?)*)|(localhost|LOCALHOST))\/?)/i,
        'url': function(urlToTest) {
            var urlMatches = this.urlRegex.exec(urlToTest);
            if(urlMatches && urlMatches.length > 0) {
                return (urlMatches[0] === urlToTest);
            } else {
                 return false;
            }
        }
    });

Thread Participants: 1

Tags for this Thread

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi