Esempio n. 1
0
 public function testIsUrl()
 {
     $this->assertTrue(jFilter::isUrl('http://foo.com/bar.html?a=b&c=d'), "isUrl('http://foo.com/bar.html?a=b&c=d')");
     $this->assertTrue(jFilter::isUrl('http://foo.com/bar.html'), "isUrl('http://foo.com/bar.html')");
     $this->assertTrue(jFilter::isUrl('http://foo.com'), "isUrl('http://foo.com')");
     $this->assertTrue(jFilter::isUrl('foo.com'), "isUrl('foo.com')");
     $this->assertTrue(jFilter::isUrl('abcdfeh'), "isUrl('abcdfeh')");
     $this->assertTrue(jFilter::isUrl('bar.html?a=b&c=d'), "isUrl('bar.html?a=b&c=d')");
     $this->assertTrue(jFilter::isUrl('foo.com/bar.html?a=b&c=d'), "isUrl('foo.com/bar.html?a=b&c=d')");
     $this->assertTrue(jFilter::isUrl('foo$^.com/bar.html?a=b&c=d'), "isUrl('foo\$^.com/bar.html?a=b&c=d')");
     $this->assertTrue(jFilter::isUrl('http://foo$^.com/bar.html?a=b&c=d'), "isUrl('http://foo\$^.com/bar.html?a=b&c=d')");
     $this->assertFalse(jFilter::isUrl('http://'), "isUrl('http://')");
 }
Esempio n. 2
0
 public function check($value)
 {
     return jFilter::isUrl($value, $this->schemeRequired, $this->hostRequired, $this->pathRequired, $this->queryRequired);
 }