forked from GNUsocial/gnu-social
ease up on the validation
darcs-hash:20080520210119-84dde-a9b74a933bd45b2e6b2f96a53a1be55caa0f7912.gz
This commit is contained in:
parent
8fcce85864
commit
e1f04061b9
@ -50,9 +50,4 @@ class Notice extends DB_DataObject
|
|||||||
function validateContent() {
|
function validateContent() {
|
||||||
return Validate::string($this->content, array('min_length' => 1, 'max_length' => 140));
|
return Validate::string($this->content, array('min_length' => 1, 'max_length' => 140));
|
||||||
}
|
}
|
||||||
|
|
||||||
function validateUrl() {
|
|
||||||
return is_null($this->url) || (strlen($this->url) == 0) ||
|
|
||||||
Validate::uri($this->url, array('allowed_schemes' => array('http', 'https')));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -83,22 +83,19 @@ class Profile extends DB_DataObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
function validateHomepage() {
|
function validateHomepage() {
|
||||||
return (is_null($this->homepage) ||
|
return (strlen($this->homepage) == 0) ||
|
||||||
Validate::uri($this->homepage, array('allowed_schemes' => array('http', 'https'))));
|
Validate::uri($this->homepage, array('allowed_schemes' => array('http', 'https'))));
|
||||||
}
|
}
|
||||||
|
|
||||||
function validateBio() {
|
function validateBio() {
|
||||||
return is_null($this->bio) ||
|
return Validate::string($this->bio, array('min_length' => 0, 'max_length' => 140));
|
||||||
Validate::string($this->bio, array('min_length' => 1, 'max_length' => 140));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function validateLocation() {
|
function validateLocation() {
|
||||||
return is_null($this->location) ||
|
return Validate::string($this->location, array('min_length' => 0, 'max_length' => 255));
|
||||||
Validate::string($this->location, array('min_length' => 1, 'max_length' => 255));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function validateFullname() {
|
function validateFullname() {
|
||||||
return is_null($this->fullname) ||
|
return Validate::string($this->fullname, array('min_length' => 0, 'max_length' => 255));
|
||||||
Validate::string($this->fullname, array('min_length' => 1, 'max_length' => 255));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user