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://')"); }
public function check($value) { return jFilter::isUrl($value, $this->schemeRequired, $this->hostRequired, $this->pathRequired, $this->queryRequired); }