trac #1155 ++ replace strlen with mb_strlen for all utf8 strings.
This commit is contained in:
parent
08db50b24e
commit
c2905085c1
|
@ -191,13 +191,13 @@ class EditgroupAction extends Action
|
||||||
array('http', 'https')))) {
|
array('http', 'https')))) {
|
||||||
$this->showForm(_('Homepage is not a valid URL.'));
|
$this->showForm(_('Homepage is not a valid URL.'));
|
||||||
return;
|
return;
|
||||||
} else if (!is_null($fullname) && strlen($fullname) > 255) {
|
} else if (!is_null($fullname) && mb_strlen($fullname) > 255) {
|
||||||
$this->showForm(_('Full name is too long (max 255 chars).'));
|
$this->showForm(_('Full name is too long (max 255 chars).'));
|
||||||
return;
|
return;
|
||||||
} else if (!is_null($description) && strlen($description) > 140) {
|
} else if (!is_null($description) && mb_strlen($description) > 140) {
|
||||||
$this->showForm(_('description is too long (max 140 chars).'));
|
$this->showForm(_('description is too long (max 140 chars).'));
|
||||||
return;
|
return;
|
||||||
} else if (!is_null($location) && strlen($location) > 255) {
|
} else if (!is_null($location) && mb_strlen($location) > 255) {
|
||||||
$this->showForm(_('Location is too long (max 255 chars).'));
|
$this->showForm(_('Location is too long (max 255 chars).'));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -242,7 +242,7 @@ class FinishopenidloginAction extends Action
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($sreg['fullname'] && strlen($sreg['fullname']) <= 255) {
|
if ($sreg['fullname'] && mb_strlen($sreg['fullname']) <= 255) {
|
||||||
$fullname = $sreg['fullname'];
|
$fullname = $sreg['fullname'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -142,13 +142,13 @@ class NewgroupAction extends Action
|
||||||
array('http', 'https')))) {
|
array('http', 'https')))) {
|
||||||
$this->showForm(_('Homepage is not a valid URL.'));
|
$this->showForm(_('Homepage is not a valid URL.'));
|
||||||
return;
|
return;
|
||||||
} else if (!is_null($fullname) && strlen($fullname) > 255) {
|
} else if (!is_null($fullname) && mb_strlen($fullname) > 255) {
|
||||||
$this->showForm(_('Full name is too long (max 255 chars).'));
|
$this->showForm(_('Full name is too long (max 255 chars).'));
|
||||||
return;
|
return;
|
||||||
} else if (!is_null($description) && strlen($description) > 140) {
|
} else if (!is_null($description) && mb_strlen($description) > 140) {
|
||||||
$this->showForm(_('description is too long (max 140 chars).'));
|
$this->showForm(_('description is too long (max 140 chars).'));
|
||||||
return;
|
return;
|
||||||
} else if (!is_null($location) && strlen($location) > 255) {
|
} else if (!is_null($location) && mb_strlen($location) > 255) {
|
||||||
$this->showForm(_('Location is too long (max 255 chars).'));
|
$this->showForm(_('Location is too long (max 255 chars).'));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -198,13 +198,13 @@ class ProfilesettingsAction extends AccountSettingsAction
|
||||||
!Validate::uri($homepage, array('allowed_schemes' => array('http', 'https')))) {
|
!Validate::uri($homepage, array('allowed_schemes' => array('http', 'https')))) {
|
||||||
$this->showForm(_('Homepage is not a valid URL.'));
|
$this->showForm(_('Homepage is not a valid URL.'));
|
||||||
return;
|
return;
|
||||||
} else if (!is_null($fullname) && strlen($fullname) > 255) {
|
} else if (!is_null($fullname) && mb_strlen($fullname) > 255) {
|
||||||
$this->showForm(_('Full name is too long (max 255 chars).'));
|
$this->showForm(_('Full name is too long (max 255 chars).'));
|
||||||
return;
|
return;
|
||||||
} else if (!is_null($bio) && strlen($bio) > 140) {
|
} else if (!is_null($bio) && mb_strlen($bio) > 140) {
|
||||||
$this->showForm(_('Bio is too long (max 140 chars).'));
|
$this->showForm(_('Bio is too long (max 140 chars).'));
|
||||||
return;
|
return;
|
||||||
} else if (!is_null($location) && strlen($location) > 255) {
|
} else if (!is_null($location) && mb_strlen($location) > 255) {
|
||||||
$this->showForm(_('Location is too long (max 255 chars).'));
|
$this->showForm(_('Location is too long (max 255 chars).'));
|
||||||
return;
|
return;
|
||||||
} else if (is_null($timezone) || !in_array($timezone, DateTimeZone::listIdentifiers())) {
|
} else if (is_null($timezone) || !in_array($timezone, DateTimeZone::listIdentifiers())) {
|
||||||
|
|
|
@ -167,13 +167,13 @@ class RegisterAction extends Action
|
||||||
array('http', 'https')))) {
|
array('http', 'https')))) {
|
||||||
$this->showForm(_('Homepage is not a valid URL.'));
|
$this->showForm(_('Homepage is not a valid URL.'));
|
||||||
return;
|
return;
|
||||||
} else if (!is_null($fullname) && strlen($fullname) > 255) {
|
} else if (!is_null($fullname) && mb_strlen($fullname) > 255) {
|
||||||
$this->showForm(_('Full name is too long (max 255 chars).'));
|
$this->showForm(_('Full name is too long (max 255 chars).'));
|
||||||
return;
|
return;
|
||||||
} else if (!is_null($bio) && strlen($bio) > 140) {
|
} else if (!is_null($bio) && mb_strlen($bio) > 140) {
|
||||||
$this->showForm(_('Bio is too long (max 140 chars).'));
|
$this->showForm(_('Bio is too long (max 140 chars).'));
|
||||||
return;
|
return;
|
||||||
} else if (!is_null($location) && strlen($location) > 255) {
|
} else if (!is_null($location) && mb_strlen($location) > 255) {
|
||||||
$this->showForm(_('Location is too long (max 255 chars).'));
|
$this->showForm(_('Location is too long (max 255 chars).'));
|
||||||
return;
|
return;
|
||||||
} else if (strlen($password) < 6) {
|
} else if (strlen($password) < 6) {
|
||||||
|
|
|
@ -56,7 +56,7 @@ class TwitapiaccountAction extends TwitterapiAction
|
||||||
|
|
||||||
$location = trim($this->arg('location'));
|
$location = trim($this->arg('location'));
|
||||||
|
|
||||||
if (!is_null($location) && strlen($location) > 255) {
|
if (!is_null($location) && mb_strlen($location) > 255) {
|
||||||
|
|
||||||
// XXX: But Twitter just truncates and runs with it. -- Zach
|
// XXX: But Twitter just truncates and runs with it. -- Zach
|
||||||
$this->clientError(_('That\'s too long. Max notice size is 255 chars.'), 406, $apidate['content-type']);
|
$this->clientError(_('That\'s too long. Max notice size is 255 chars.'), 406, $apidate['content-type']);
|
||||||
|
|
|
@ -93,22 +93,22 @@ class UpdateprofileAction extends Action
|
||||||
}
|
}
|
||||||
# optional stuff
|
# optional stuff
|
||||||
$fullname = $req->get_parameter('omb_listenee_fullname');
|
$fullname = $req->get_parameter('omb_listenee_fullname');
|
||||||
if ($fullname && strlen($fullname) > 255) {
|
if ($fullname && mb_strlen($fullname) > 255) {
|
||||||
$this->clientError(_("Full name is too long (max 255 chars)."));
|
$this->clientError(_("Full name is too long (max 255 chars)."));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
$homepage = $req->get_parameter('omb_listenee_homepage');
|
$homepage = $req->get_parameter('omb_listenee_homepage');
|
||||||
if ($homepage && (!common_valid_http_url($homepage) || strlen($homepage) > 255)) {
|
if ($homepage && (!common_valid_http_url($homepage) || mb_strlen($homepage) > 255)) {
|
||||||
$this->clientError(sprintf(_("Invalid homepage '%s'"), $homepage));
|
$this->clientError(sprintf(_("Invalid homepage '%s'"), $homepage));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
$bio = $req->get_parameter('omb_listenee_bio');
|
$bio = $req->get_parameter('omb_listenee_bio');
|
||||||
if ($bio && strlen($bio) > 140) {
|
if ($bio && mb_strlen($bio) > 140) {
|
||||||
$this->clientError(_("Bio is too long (max 140 chars)."));
|
$this->clientError(_("Bio is too long (max 140 chars)."));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
$location = $req->get_parameter('omb_listenee_location');
|
$location = $req->get_parameter('omb_listenee_location');
|
||||||
if ($location && strlen($location) > 255) {
|
if ($location && mb_strlen($location) > 255) {
|
||||||
$this->clientError(_("Location is too long (max 255 chars)."));
|
$this->clientError(_("Location is too long (max 255 chars)."));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -469,19 +469,19 @@ class UserauthorizationAction extends Action
|
||||||
}
|
}
|
||||||
# optional stuff
|
# optional stuff
|
||||||
$fullname = $req->get_parameter('omb_listenee_fullname');
|
$fullname = $req->get_parameter('omb_listenee_fullname');
|
||||||
if ($fullname && strlen($fullname) > 255) {
|
if ($fullname && mb_strlen($fullname) > 255) {
|
||||||
throw new OAuthException("Full name '$fullname' too long.");
|
throw new OAuthException("Full name '$fullname' too long.");
|
||||||
}
|
}
|
||||||
$homepage = $req->get_parameter('omb_listenee_homepage');
|
$homepage = $req->get_parameter('omb_listenee_homepage');
|
||||||
if ($homepage && (!common_valid_http_url($homepage) || strlen($homepage) > 255)) {
|
if ($homepage && (!common_valid_http_url($homepage) || mb_strlen($homepage) > 255)) {
|
||||||
throw new OAuthException("Invalid homepage '$homepage'");
|
throw new OAuthException("Invalid homepage '$homepage'");
|
||||||
}
|
}
|
||||||
$bio = $req->get_parameter('omb_listenee_bio');
|
$bio = $req->get_parameter('omb_listenee_bio');
|
||||||
if ($bio && strlen($bio) > 140) {
|
if ($bio && mb_strlen($bio) > 140) {
|
||||||
throw new OAuthException("Bio too long '$bio'");
|
throw new OAuthException("Bio too long '$bio'");
|
||||||
}
|
}
|
||||||
$location = $req->get_parameter('omb_listenee_location');
|
$location = $req->get_parameter('omb_listenee_location');
|
||||||
if ($location && strlen($location) > 255) {
|
if ($location && mb_strlen($location) > 255) {
|
||||||
throw new OAuthException("Location too long '$location'");
|
throw new OAuthException("Location too long '$location'");
|
||||||
}
|
}
|
||||||
$avatar = $req->get_parameter('omb_listenee_avatar');
|
$avatar = $req->get_parameter('omb_listenee_avatar');
|
||||||
|
|
Loading…
Reference in New Issue
Block a user