Made certain strings less ugly.

This commit is contained in:
flash 2025-02-09 16:41:09 +00:00
parent cc37b7cad3
commit 7bf9a7eedd
17 changed files with 273 additions and 249 deletions

View file

@ -157,7 +157,7 @@ switch($commentMode) {
: 0;
$categoryInfo = $msz->comments->getCategory(categoryId: (string)$categoryId);
} catch(RuntimeException $ex) {
Template::displayInfo('This comment category doesn\'t exist.', 404);
Template::displayInfo("This comment category doesn't exist.", 404);
}
$canLock = $perms->check(Perm::G_COMMENTS_LOCK);

View file

@ -36,7 +36,7 @@ while($_SERVER['REQUEST_METHOD'] === 'POST' && CSRF::validateRequest()) {
$userRank = $msz->usersCtx->users->getUserRank($currentUser);
if(!$isNew && !$currentUser->super && $roleInfo->rank >= $userRank) {
echo 'You aren\'t allowed to edit this role.';
echo "You aren't allowed to edit this role.";
break;
}
@ -67,7 +67,7 @@ while($_SERVER['REQUEST_METHOD'] === 'POST' && CSRF::validateRequest()) {
]);
if(!$currentUser->super && $roleRank >= $userRank) {
echo 'You aren\'t allowed to make a role with equal rank to your own.';
echo "You aren't allowed to make a role with equal rank to your own.";
break;
}

View file

@ -52,7 +52,7 @@ if(CSRF::validateRequest() && $canEdit) {
if(!$canImpersonate) {
$notices[] = 'You must be a super user to do this.';
} elseif(!is_string($_POST['impersonate_user']) || $_POST['impersonate_user'] !== 'meow') {
$notices[] = 'You didn\'t say the magic word.';
$notices[] = "You didn't say the magic word!";
} else {
$allowToImpersonate = $currentUser->super;
@ -71,7 +71,7 @@ if(CSRF::validateRequest() && $canEdit) {
AuthTokenCookie::apply($msz->authCtx->createAuthTokenPacker()->pack($tokenInfo));
Tools::redirect($msz->urls->format('index'));
return;
} else $notices[] = 'You aren\'t allowed to impersonate this user.';
} else $notices[] = "You aren't allowed to impersonate this user.";
}
}
@ -147,7 +147,7 @@ if(CSRF::validateRequest() && $canEdit) {
$displayRole = (string)($_POST['user']['display_role'] ?? 0);
if(!$msz->usersCtx->users->hasRole($userInfo, $displayRole))
$notices[] = 'User does not have the role you\'re trying to assign as primary.';
$notices[] = "User does not have the role you're trying to assign as primary.";
$countryValidation = strlen($setCountry) === 2
&& ctype_alpha($setCountry)

View file

@ -109,13 +109,13 @@ if($isEditing) {
if(!empty($_POST)) {
if(!CSRF::validateRequest()) {
$notices[] = 'Couldn\'t verify you, please refresh the page and retry.';
$notices[] = "Couldn't verify you, please refresh the page and retry.";
} else {
$profileFieldsSubmit = filter_input(INPUT_POST, 'profile', FILTER_DEFAULT, FILTER_REQUIRE_ARRAY);
if(!empty($profileFieldsSubmit)) {
if(!$perms->edit_profile) {
$notices[] = 'You\'re not allowed to edit your profile';
$notices[] = "You're not allowed to edit your profile.";
} else {
$profileFieldInfos = iterator_to_array($msz->profileCtx->fields->getFields());
$profileFieldsSetInfos = [];
@ -135,7 +135,7 @@ if($isEditing) {
$profileFieldsSetInfos[] = $fieldInfo;
$profileFieldsSetValues[] = $fieldValue;
} else
$notices[] = sprintf('%s isn\'t properly formatted.', $fieldInfo->title);
$notices[] = sprintf("%s isn't properly formatted.", $fieldInfo->title);
unset($fieldName, $fieldValue, $fieldInfo);
}
@ -209,7 +209,7 @@ if($isEditing) {
$avatarAsset->delete();
} else {
if(!$perms->edit_avatar) {
$notices[] = 'You aren\'t allow to change your avatar.';
$notices[] = "You aren't allow to change your avatar.";
} elseif(!empty($_FILES['avatar'])
&& is_array($_FILES['avatar'])
&& !empty($_FILES['avatar']['name']['file'])) {
@ -237,7 +237,7 @@ if($isEditing) {
$notices[] = match($exMessage) {
'$path is not a valid image.' => 'The file you uploaded was not an image!',
'$path is not an allowed image file.' => 'This type of image is not supported, keep to PNG, JPG or GIF!',
'Dimensions of $path are too large.' => sprintf('Your avatar can\'t be larger than %dx%d!', $avatarAsset->getMaxWidth(), $avatarAsset->getMaxHeight()),
'Dimensions of $path are too large.' => sprintf("Your avatar can't be larger than %dx%d!", $avatarAsset->getMaxWidth(), $avatarAsset->getMaxHeight()),
'File size of $path is too large.' => sprintf('Your avatar is not allowed to be larger in file size than %s!', ByteFormat::format($avatarAsset->getMaxBytes())),
default => $exMessage,
};
@ -258,7 +258,7 @@ if($isEditing) {
$backgroundAsset = null;
} else {
if(!$perms->edit_background) {
$notices[] = 'You aren\'t allow to change your background.';
$notices[] = "You aren't allow to change your background.";
} elseif(!empty($_FILES['bg_file']) && is_array($_FILES['bg_file'])) {
if(!empty($_FILES['bg_file']['name'])) {
if($_FILES['bg_file']['error'] !== UPLOAD_ERR_OK) {
@ -285,7 +285,7 @@ if($isEditing) {
$notices[] = match($exMessage) {
'$path is not a valid image.' => 'The file you uploaded was not an image!',
'$path is not an allowed image file.' => 'This type of image is not supported, keep to PNG, JPG or GIF!',
'Dimensions of $path are too large.' => sprintf('Your background can\'t be larger than %dx%d!', $backgroundAsset->getMaxWidth(), $backgroundAsset->getMaxHeight()),
'Dimensions of $path are too large.' => sprintf("Your background can't be larger than %dx%d!", $backgroundAsset->getMaxWidth(), $backgroundAsset->getMaxHeight()),
'File size of $path is too large.' => sprintf('Your background is not allowed to be larger in file size than %s!', ByteFormat::format($backgroundAsset->getMaxBytes())),
default => $exMessage,
};