*/
public function getShortName($chars = 8)
{
- if (strlen($this->name) <= $chars) {
+ if (mb_strlen($this->name) <= $chars) {
return $this->name;
}
$splitName = explode(' ', $this->name);
- if (strlen($splitName[0]) <= $chars) {
+ if (mb_strlen($splitName[0]) <= $chars) {
return $splitName[0];
}
if (empty($email)) {
$email = $this->ask('Please specify an email address for the new admin user');
}
- if (strlen($email) < 5 || !filter_var($email, FILTER_VALIDATE_EMAIL)) {
+ if (mb_strlen($email) < 5 || !filter_var($email, FILTER_VALIDATE_EMAIL)) {
return $this->error('Invalid email address provided');
}
if (empty($name)) {
$name = $this->ask('Please specify an name for the new admin user');
}
- if (strlen($name) < 2) {
+ if (mb_strlen($name) < 2) {
return $this->error('Invalid name provided');
}
if (empty($password)) {
$password = $this->secret('Please specify a password for the new admin user');
}
- if (strlen($password) < 5) {
+ if (mb_strlen($password) < 5) {
return $this->error('Invalid password provided, Must be at least 5 characters');
}
public function getExcerpt(int $length = 100)
{
$description = $this->description;
- return strlen($description) > $length ? substr($description, 0, $length-3) . '...' : $description;
+ return mb_strlen($description) > $length ? mb_substr($description, 0, $length-3) . '...' : $description;
}
/**
public function getExcerpt(int $length = 100)
{
$description = $this->description;
- return strlen($description) > $length ? substr($description, 0, $length-3) . '...' : $description;
+ return mb_strlen($description) > $length ? mb_substr($description, 0, $length-3) . '...' : $description;
}
/**
public function getExcerpt(int $length = 100)
{
$description = $this->text ?? $this->description;
- return strlen($description) > $length ? substr($description, 0, $length-3) . '...' : $description;
+ return mb_strlen($description) > $length ? mb_substr($description, 0, $length-3) . '...' : $description;
}
/**
// Create an unique id for the element
// Uses the content as a basis to ensure output is the same every time
// the same content is passed through.
- $contentId = 'bkmrk-' . substr(strtolower(preg_replace('/\s+/', '-', trim($element->nodeValue))), 0, 20);
+ $contentId = 'bkmrk-' . mb_substr(strtolower(preg_replace('/\s+/', '-', trim($element->nodeValue))), 0, 20);
$newId = urlencode($contentId);
$loopIndex = 0;
$tree = collect($headers)->map(function($header) {
$text = trim(str_replace("\xc2\xa0", '', $header->nodeValue));
- if (strlen($text) > 30) {
- $text = substr($text, 0, 27) . '...';
+ if (mb_strlen($text) > 30) {
+ $text = mb_substr($text, 0, 27) . '...';
}
return [
'text' => $text,
];
})->filter(function($header) {
- return strlen($header['text']) > 0;
+ return mb_strlen($header['text']) > 0;
});
// Normalise headers if only smaller headers have been used
if ($registrationRestrict) {
$restrictedEmailDomains = explode(',', str_replace(' ', '', $registrationRestrict));
- $userEmailDomain = $domain = substr(strrchr($userData['email'], "@"), 1);
+ $userEmailDomain = $domain = mb_substr(mb_strrchr($userData['email'], "@"), 1);
if (!in_array($userEmailDomain, $restrictedEmailDomains)) {
throw new UserRegistrationException(trans('auth.registration_email_domain_invalid'), '/register');
}
// Remove non-specified domain if forced and we have a domain
if ($isFullUrl && $forceAppDomain) {
if (!empty($base) && strpos($path, $base) === 0) {
- $path = substr($path, strlen($base));
+ $path = mb_substr($path, mb_strlen($base));
} else {
$explodedPath = explode('/', $path);
$path = implode('/', array_splice($explodedPath, 3));