mirror of
https://github.com/BookStackApp/BookStack.git
synced 2026-02-18 19:06:51 +03:00
Compare commits
14 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0e799a3857 | ||
|
|
b91d6e2bfa | ||
|
|
44315233d7 | ||
|
|
91efa601be | ||
|
|
18f86fbf9b | ||
|
|
e5a96b0cb0 | ||
|
|
526be33ab2 | ||
|
|
831f441879 | ||
|
|
ea16ad7e94 | ||
|
|
ba6eb54552 | ||
|
|
47e3ef1be2 | ||
|
|
7791599fb5 | ||
|
|
bbfb330b92 | ||
|
|
20729a618f |
1
.github/translators.txt
vendored
1
.github/translators.txt
vendored
@@ -132,3 +132,4 @@ Kauê Sena (kaue.sena.ks) :: Portuguese, Brazilian
|
||||
MatthieuParis :: French
|
||||
Douradinho :: Portuguese, Brazilian
|
||||
Gaku Yaguchi (tama11) :: Japanese
|
||||
johnroyer :: Chinese Traditional
|
||||
|
||||
@@ -533,7 +533,8 @@ class PermissionService
|
||||
$allPermission = $this->currentUser() && $this->currentUser()->can($permission . '-all');
|
||||
$ownPermission = $this->currentUser() && $this->currentUser()->can($permission . '-own');
|
||||
$this->currentAction = 'view';
|
||||
$isOwner = $this->currentUser() && $this->currentUser()->id === $ownable->created_by;
|
||||
$ownerField = ($ownable instanceof Entity) ? 'owned_by' : 'created_by';
|
||||
$isOwner = $this->currentUser() && $this->currentUser()->id === $ownable->$ownerField;
|
||||
return ($allPermission || ($isOwner && $ownPermission));
|
||||
}
|
||||
|
||||
|
||||
@@ -210,10 +210,10 @@ class PageRepo
|
||||
}
|
||||
|
||||
$pageContent = new PageContent($page);
|
||||
if (isset($input['html'])) {
|
||||
$pageContent->setNewHTML($input['html']);
|
||||
} else {
|
||||
if (!empty($input['markdown'] ?? '')) {
|
||||
$pageContent->setNewMarkdown($input['markdown']);
|
||||
} else {
|
||||
$pageContent->setNewHTML($input['html']);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -5,6 +5,9 @@ use DOMDocument;
|
||||
use DOMNodeList;
|
||||
use DOMXPath;
|
||||
use League\CommonMark\CommonMarkConverter;
|
||||
use League\CommonMark\Environment;
|
||||
use League\CommonMark\Extension\Table\TableExtension;
|
||||
use League\CommonMark\Extension\TaskList\TaskListExtension;
|
||||
|
||||
class PageContent
|
||||
{
|
||||
@@ -45,7 +48,10 @@ class PageContent
|
||||
*/
|
||||
protected function markdownToHtml(string $markdown): string
|
||||
{
|
||||
$converter = new CommonMarkConverter();
|
||||
$environment = Environment::createCommonMarkEnvironment();
|
||||
$environment->addExtension(new TableExtension());
|
||||
$environment->addExtension(new TaskListExtension());
|
||||
$converter = new CommonMarkConverter([], $environment);
|
||||
return $converter->convertToHtml($markdown);
|
||||
}
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
use BookStack\Auth\User;
|
||||
use BookStack\Exceptions\HttpFetchException;
|
||||
use Exception;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
class UserAvatars
|
||||
{
|
||||
|
||||
2
public/dist/app.js
vendored
2
public/dist/app.js
vendored
File diff suppressed because one or more lines are too long
2
public/dist/export-styles.css
vendored
2
public/dist/export-styles.css
vendored
File diff suppressed because one or more lines are too long
2
public/dist/styles.css
vendored
2
public/dist/styles.css
vendored
File diff suppressed because one or more lines are too long
@@ -74,7 +74,6 @@ class PageEditor {
|
||||
}
|
||||
|
||||
setInitialFocus() {
|
||||
console.log({'HAS': this.hasDefaultTitle});
|
||||
if (this.hasDefaultTitle) {
|
||||
return this.titleElem.select();
|
||||
}
|
||||
|
||||
@@ -210,7 +210,7 @@ return [
|
||||
'pages_revisions' => 'Revisiones de página',
|
||||
'pages_revisions_named' => 'Revisiones de página para :pageName',
|
||||
'pages_revision_named' => 'Revisión de ágina para :pageName',
|
||||
'pages_revision_restored_from' => 'Restored from #:id; :summary',
|
||||
'pages_revision_restored_from' => 'Restaurado de #:id; :summary',
|
||||
'pages_revisions_created_by' => 'Creado por',
|
||||
'pages_revisions_date' => 'Fecha de revisión',
|
||||
'pages_revisions_number' => '#',
|
||||
|
||||
@@ -22,7 +22,7 @@ return [
|
||||
'meta_created_name' => 'Créé :timeLength par :user',
|
||||
'meta_updated' => 'Mis à jour :timeLength',
|
||||
'meta_updated_name' => 'Mis à jour :timeLength par :user',
|
||||
'meta_owned_name' => 'Owned by :user',
|
||||
'meta_owned_name' => 'Possédé par :user',
|
||||
'entity_select' => 'Sélectionner l\'entité',
|
||||
'images' => 'Images',
|
||||
'my_recent_drafts' => 'Mes brouillons récents',
|
||||
@@ -40,7 +40,7 @@ return [
|
||||
'permissions_intro' => 'Une fois activées ces permissions prendront la priorité sur tous les sets de permissions préexistants.',
|
||||
'permissions_enable' => 'Activer les permissions personnalisées',
|
||||
'permissions_save' => 'Enregistrer les permissions',
|
||||
'permissions_owner' => 'Owner',
|
||||
'permissions_owner' => 'Propriétaire',
|
||||
|
||||
// Search
|
||||
'search_results' => 'Résultats de recherche',
|
||||
@@ -210,7 +210,7 @@ return [
|
||||
'pages_revisions' => 'Révisions de la page',
|
||||
'pages_revisions_named' => 'Révisions pour :pageName',
|
||||
'pages_revision_named' => 'Révision pour :pageName',
|
||||
'pages_revision_restored_from' => 'Restored from #:id; :summary',
|
||||
'pages_revision_restored_from' => 'Restauré à partir de #:id; :summary',
|
||||
'pages_revisions_created_by' => 'Créé par',
|
||||
'pages_revisions_date' => 'Date de révision',
|
||||
'pages_revisions_number' => '#',
|
||||
|
||||
@@ -175,10 +175,10 @@ return [
|
||||
'users_delete_named' => 'Supprimer l\'utilisateur :userName',
|
||||
'users_delete_warning' => 'Ceci va supprimer \':userName\' du système.',
|
||||
'users_delete_confirm' => 'Êtes-vous sûr(e) de vouloir supprimer cet utilisateur ?',
|
||||
'users_migrate_ownership' => 'Migrate Ownership',
|
||||
'users_migrate_ownership_desc' => 'Select a user here if you want another user to become the owner of all items currently owned by this user.',
|
||||
'users_none_selected' => 'No user selected',
|
||||
'users_delete_success' => 'User successfully removed',
|
||||
'users_migrate_ownership' => 'Migré propriété',
|
||||
'users_migrate_ownership_desc' => 'Sélectionnez un utilisateur ici si vous voulez qu\'un autre utilisateur devienne le propriétaire de tous les éléments actuellement détenus par cet utilisateur.',
|
||||
'users_none_selected' => 'Aucun utilisateur n\'a été séléctionné',
|
||||
'users_delete_success' => 'Utilisateur supprimé avec succès',
|
||||
'users_edit' => 'Modifier l\'utilisateur',
|
||||
'users_edit_profile' => 'Modifier le profil',
|
||||
'users_edit_success' => 'Utilisateur mis à jour avec succès',
|
||||
@@ -239,7 +239,7 @@ return [
|
||||
'ja' => '日本語',
|
||||
'ko' => '한국어',
|
||||
'nl' => 'Nederlands',
|
||||
'nb' => 'Norsk (Bokmål)',
|
||||
'nb' => 'Norvegien',
|
||||
'pl' => 'Polski',
|
||||
'pt_BR' => 'Português do Brasil',
|
||||
'ru' => 'Русский',
|
||||
|
||||
@@ -81,18 +81,18 @@ return [
|
||||
'maint_send_test_email_mail_greeting' => 'L\'invio delle email sembra funzionare!',
|
||||
'maint_send_test_email_mail_text' => 'Congratulazioni! Siccome hai ricevuto questa notifica email, le tue impostazioni sembrano essere configurate correttamente.',
|
||||
'maint_recycle_bin_desc' => 'Deleted shelves, books, chapters & pages are sent to the recycle bin so they can be restored or permanently deleted. Older items in the recycle bin may be automatically removed after a while depending on system configuration.',
|
||||
'maint_recycle_bin_open' => 'Open Recycle Bin',
|
||||
'maint_recycle_bin_open' => 'Apri il Cestino',
|
||||
|
||||
// Recycle Bin
|
||||
'recycle_bin' => 'Recycle Bin',
|
||||
'recycle_bin' => 'Cestino',
|
||||
'recycle_bin_desc' => 'Here you can restore items that have been deleted or choose to permanently remove them from the system. This list is unfiltered unlike similar activity lists in the system where permission filters are applied.',
|
||||
'recycle_bin_deleted_item' => 'Deleted Item',
|
||||
'recycle_bin_deleted_by' => 'Deleted By',
|
||||
'recycle_bin_deleted_at' => 'Deletion Time',
|
||||
'recycle_bin_permanently_delete' => 'Permanently Delete',
|
||||
'recycle_bin_restore' => 'Restore',
|
||||
'recycle_bin_deleted_by' => 'Cancellato da',
|
||||
'recycle_bin_deleted_at' => 'Orario Cancellazione',
|
||||
'recycle_bin_permanently_delete' => 'Elimina Definitivamente',
|
||||
'recycle_bin_restore' => 'Ripristina',
|
||||
'recycle_bin_contents_empty' => 'The recycle bin is currently empty',
|
||||
'recycle_bin_empty' => 'Empty Recycle Bin',
|
||||
'recycle_bin_empty' => 'Svuota Cestino',
|
||||
'recycle_bin_empty_confirm' => 'This will permanently destroy all items in the recycle bin including content contained within each item. Are you sure you want to empty the recycle bin?',
|
||||
'recycle_bin_destroy_confirm' => 'This action will permanently delete this item, along with any child elements listed below, from the system and you will not be able to restore this content. Are you sure you want to permanently delete this item?',
|
||||
'recycle_bin_destroy_list' => 'Items to be Destroyed',
|
||||
@@ -109,8 +109,8 @@ return [
|
||||
'audit_event_filter_no_filter' => 'No Filter',
|
||||
'audit_deleted_item' => 'Deleted Item',
|
||||
'audit_deleted_item_name' => 'Name: :name',
|
||||
'audit_table_user' => 'User',
|
||||
'audit_table_event' => 'Event',
|
||||
'audit_table_user' => 'Utente',
|
||||
'audit_table_event' => 'Evento',
|
||||
'audit_table_related' => 'Related Item or Detail',
|
||||
'audit_table_date' => 'Activity Date',
|
||||
'audit_date_from' => 'Date Range From',
|
||||
@@ -177,8 +177,8 @@ return [
|
||||
'users_delete_confirm' => 'Sei sicuro di voler eliminare questo utente?',
|
||||
'users_migrate_ownership' => 'Migrate Ownership',
|
||||
'users_migrate_ownership_desc' => 'Select a user here if you want another user to become the owner of all items currently owned by this user.',
|
||||
'users_none_selected' => 'No user selected',
|
||||
'users_delete_success' => 'User successfully removed',
|
||||
'users_none_selected' => 'Nessun utente selezionato',
|
||||
'users_delete_success' => 'Utente rimosso con successo',
|
||||
'users_edit' => 'Modifica Utente',
|
||||
'users_edit_profile' => 'Modifica Profilo',
|
||||
'users_edit_success' => 'Utente aggiornato correttamente',
|
||||
|
||||
@@ -45,5 +45,5 @@ return [
|
||||
|
||||
// Other
|
||||
'commented_on' => 'прокомментировал',
|
||||
'permissions_update' => 'updated permissions',
|
||||
'permissions_update' => 'обновил разрешения',
|
||||
];
|
||||
|
||||
@@ -22,7 +22,7 @@ return [
|
||||
'meta_created_name' => ':user создал :timeLength',
|
||||
'meta_updated' => 'Обновлено :timeLength',
|
||||
'meta_updated_name' => ':user обновил :timeLength',
|
||||
'meta_owned_name' => 'Owned by :user',
|
||||
'meta_owned_name' => 'Владелец :user',
|
||||
'entity_select' => 'Выбор объекта',
|
||||
'images' => 'Изображения',
|
||||
'my_recent_drafts' => 'Мои последние черновики',
|
||||
@@ -40,7 +40,7 @@ return [
|
||||
'permissions_intro' => 'После включения опции эти разрешения будут иметь приоритет над любыми установленными разрешениями роли.',
|
||||
'permissions_enable' => 'Включение пользовательских разрешений',
|
||||
'permissions_save' => 'Сохранить разрешения',
|
||||
'permissions_owner' => 'Owner',
|
||||
'permissions_owner' => 'Владелец',
|
||||
|
||||
// Search
|
||||
'search_results' => 'Результаты поиска',
|
||||
@@ -148,7 +148,7 @@ return [
|
||||
'chapters_create' => 'Создать новую главу',
|
||||
'chapters_delete' => 'Удалить главу',
|
||||
'chapters_delete_named' => 'Удалить главу :chapterName',
|
||||
'chapters_delete_explain' => 'This will delete the chapter with the name \':chapterName\'. All pages that exist within this chapter will also be deleted.',
|
||||
'chapters_delete_explain' => 'Это действие удалит главу с названием \':chapterName\'. Все страницы, которые существуют в этой главе, также будут удалены.',
|
||||
'chapters_delete_confirm' => 'Вы действительно хотите удалить эту главу?',
|
||||
'chapters_edit' => 'Редактировать главу',
|
||||
'chapters_edit_named' => 'Редактировать главу :chapterName',
|
||||
@@ -210,7 +210,7 @@ return [
|
||||
'pages_revisions' => 'Версии страницы',
|
||||
'pages_revisions_named' => 'Версии страницы для :pageName',
|
||||
'pages_revision_named' => 'Версия страницы для :pageName',
|
||||
'pages_revision_restored_from' => 'Restored from #:id; :summary',
|
||||
'pages_revision_restored_from' => 'Восстановлено из #:id; :summary',
|
||||
'pages_revisions_created_by' => 'Создана',
|
||||
'pages_revisions_date' => 'Дата версии',
|
||||
'pages_revisions_number' => '#',
|
||||
|
||||
@@ -68,7 +68,7 @@ return [
|
||||
'maint' => 'Обслуживание',
|
||||
'maint_image_cleanup' => 'Очистка изображений',
|
||||
'maint_image_cleanup_desc' => "Сканирует содержимое страниц и предыдущих версий и определяет изображения, которые не используются. Убедитесь, что у вас есть резервная копия базы данных и папки изображений перед запуском этой функции.",
|
||||
'maint_delete_images_only_in_revisions' => 'Also delete images that only exist in old page revisions',
|
||||
'maint_delete_images_only_in_revisions' => 'Также удалять изображения, которые существуют только в старой версии страницы',
|
||||
'maint_image_cleanup_run' => 'Выполнить очистку',
|
||||
'maint_image_cleanup_warning' => 'Найдено :count возможно бесполезных изображений. Вы уверены, что хотите удалить эти изображения?',
|
||||
'maint_image_cleanup_success' => ':count возможно бесполезных изображений было найдено и удалено!',
|
||||
@@ -80,38 +80,38 @@ return [
|
||||
'maint_send_test_email_mail_subject' => 'Проверка электронной почты',
|
||||
'maint_send_test_email_mail_greeting' => 'Доставка электронной почты работает!',
|
||||
'maint_send_test_email_mail_text' => 'Поздравляем! Поскольку вы получили это письмо, электронная почта настроена правильно.',
|
||||
'maint_recycle_bin_desc' => 'Deleted shelves, books, chapters & pages are sent to the recycle bin so they can be restored or permanently deleted. Older items in the recycle bin may be automatically removed after a while depending on system configuration.',
|
||||
'maint_recycle_bin_open' => 'Open Recycle Bin',
|
||||
'maint_recycle_bin_desc' => 'Удаленные полки, книги, главы и страницы отправляются в корзину, чтобы они могли быть восстановлены или удалены навсегда. Более старые элементы в корзине могут быть автоматически удалены через некоторое время в зависимости от системной конфигурации.',
|
||||
'maint_recycle_bin_open' => 'Открыть корзину',
|
||||
|
||||
// Recycle Bin
|
||||
'recycle_bin' => 'Recycle Bin',
|
||||
'recycle_bin_desc' => 'Here you can restore items that have been deleted or choose to permanently remove them from the system. This list is unfiltered unlike similar activity lists in the system where permission filters are applied.',
|
||||
'recycle_bin_deleted_item' => 'Deleted Item',
|
||||
'recycle_bin_deleted_by' => 'Deleted By',
|
||||
'recycle_bin_deleted_at' => 'Deletion Time',
|
||||
'recycle_bin_permanently_delete' => 'Permanently Delete',
|
||||
'recycle_bin_restore' => 'Restore',
|
||||
'recycle_bin_contents_empty' => 'The recycle bin is currently empty',
|
||||
'recycle_bin_empty' => 'Empty Recycle Bin',
|
||||
'recycle_bin_empty_confirm' => 'This will permanently destroy all items in the recycle bin including content contained within each item. Are you sure you want to empty the recycle bin?',
|
||||
'recycle_bin_destroy_confirm' => 'This action will permanently delete this item, along with any child elements listed below, from the system and you will not be able to restore this content. Are you sure you want to permanently delete this item?',
|
||||
'recycle_bin_destroy_list' => 'Items to be Destroyed',
|
||||
'recycle_bin_restore_list' => 'Items to be Restored',
|
||||
'recycle_bin_restore_confirm' => 'This action will restore the deleted item, including any child elements, to their original location. If the original location has since been deleted, and is now in the recycle bin, the parent item will also need to be restored.',
|
||||
'recycle_bin_restore_deleted_parent' => 'The parent of this item has also been deleted. These will remain deleted until that parent is also restored.',
|
||||
'recycle_bin_destroy_notification' => 'Deleted :count total items from the recycle bin.',
|
||||
'recycle_bin_restore_notification' => 'Restored :count total items from the recycle bin.',
|
||||
'recycle_bin' => 'Корзина',
|
||||
'recycle_bin_desc' => 'Здесь вы можете восстановить удаленные элементы или навсегда удалить их из системы. Этот список не отфильтрован в отличие от аналогичных списков действий в системе, где применяются фильтры.',
|
||||
'recycle_bin_deleted_item' => 'Удаленный элемент',
|
||||
'recycle_bin_deleted_by' => 'Удалён',
|
||||
'recycle_bin_deleted_at' => 'Время удаления',
|
||||
'recycle_bin_permanently_delete' => 'Удалить навсегда',
|
||||
'recycle_bin_restore' => 'Восстановить',
|
||||
'recycle_bin_contents_empty' => 'На данный момент корзина пуста',
|
||||
'recycle_bin_empty' => 'Очистить корзину',
|
||||
'recycle_bin_empty_confirm' => 'Это действие навсегда уничтожит все элементы в корзине, включая содержимое, содержащееся в каждом элементе. Вы уверены, что хотите очистить корзину?',
|
||||
'recycle_bin_destroy_confirm' => 'Это действие удалит этот элемент навсегда вместе с любыми дочерними элементами, перечисленными ниже, и вы не сможете восстановить этот контент. Вы уверены, что хотите навсегда удалить этот элемент?',
|
||||
'recycle_bin_destroy_list' => 'Элементы для удаления',
|
||||
'recycle_bin_restore_list' => 'Элементы для восстановления',
|
||||
'recycle_bin_restore_confirm' => 'Это действие восстановит удаленный элемент, включая дочерние, в исходное место. Если исходное место было удалено и теперь находится в корзине, родительский элемент также необходимо будет восстановить.',
|
||||
'recycle_bin_restore_deleted_parent' => 'Родитель этого элемента также был удален. Элементы будут удалены до тех пор, пока этот родитель не будет восстановлен.',
|
||||
'recycle_bin_destroy_notification' => 'Удалено :count элементов из корзины.',
|
||||
'recycle_bin_restore_notification' => 'Восстановлено :count элементов из корзины',
|
||||
|
||||
// Audit Log
|
||||
'audit' => 'Журнал аудита',
|
||||
'audit_desc' => 'Этот журнал аудита отображает список действий, отслеживаемых в системе. Этот список не отфильтрован в отличие от аналогичных списков действий в системе, где применяются фильтры разрешений.',
|
||||
'audit_desc' => 'Этот журнал аудита отображает список действий, отслеживаемых в системе. Этот список не отфильтрован в отличие от аналогичных списков действий в системе, где применяются фильтры.',
|
||||
'audit_event_filter' => 'Фильтр событий',
|
||||
'audit_event_filter_no_filter' => 'Без фильтра',
|
||||
'audit_deleted_item' => 'Удаленный элемент',
|
||||
'audit_deleted_item_name' => 'Имя: :name',
|
||||
'audit_table_user' => 'Пользователь',
|
||||
'audit_table_event' => 'Событие',
|
||||
'audit_table_related' => 'Related Item or Detail',
|
||||
'audit_table_related' => 'Связанный элемент',
|
||||
'audit_table_date' => 'Дата действия',
|
||||
'audit_date_from' => 'Диапазон даты от',
|
||||
'audit_date_to' => 'Диапазон даты до',
|
||||
@@ -157,7 +157,7 @@ return [
|
||||
'user_profile' => 'Профиль пользователя',
|
||||
'users_add_new' => 'Добавить пользователя',
|
||||
'users_search' => 'Поиск пользователей',
|
||||
'users_latest_activity' => 'Latest Activity',
|
||||
'users_latest_activity' => 'Последние действия',
|
||||
'users_details' => 'Данные пользователя',
|
||||
'users_details_desc' => 'Укажите имя и адрес электронной почты для этого пользователя. Адрес электронной почты будет использоваться для входа в приложение.',
|
||||
'users_details_desc_no_email' => 'Задайте имя для этого пользователя, чтобы другие могли его узнать.',
|
||||
@@ -173,12 +173,12 @@ return [
|
||||
'users_system_public' => 'Этот пользователь представляет любых гостевых пользователей, которые посещают ваше приложение. Он не может использоваться для входа в систему и назначается автоматически.',
|
||||
'users_delete' => 'Удалить пользователя',
|
||||
'users_delete_named' => 'Удалить пользователя :userName',
|
||||
'users_delete_warning' => 'Это полностью удалит пользователя с именем \':userName\' из системы.',
|
||||
'users_delete_warning' => 'Это полностью удалит пользователя \':userName\' из системы.',
|
||||
'users_delete_confirm' => 'Вы уверены что хотите удалить этого пользователя?',
|
||||
'users_migrate_ownership' => 'Migrate Ownership',
|
||||
'users_migrate_ownership_desc' => 'Select a user here if you want another user to become the owner of all items currently owned by this user.',
|
||||
'users_none_selected' => 'No user selected',
|
||||
'users_delete_success' => 'User successfully removed',
|
||||
'users_migrate_ownership' => 'Наследник контента',
|
||||
'users_migrate_ownership_desc' => 'Выберите пользователя, если вы хотите, чтобы он стал владельцем всех элементов, в настоящее время принадлежащих удаляемому пользователю.',
|
||||
'users_none_selected' => 'Пользователь не выбран',
|
||||
'users_delete_success' => 'Пользователь успешно удален',
|
||||
'users_edit' => 'Редактировать пользователя',
|
||||
'users_edit_profile' => 'Редактировать профиль',
|
||||
'users_edit_success' => 'Пользователь успешно обновлен',
|
||||
|
||||
@@ -22,7 +22,7 @@ return [
|
||||
'meta_created_name' => '由 :user 创建于 :timeLength',
|
||||
'meta_updated' => '更新于 :timeLength',
|
||||
'meta_updated_name' => '由 :user 更新于 :timeLength',
|
||||
'meta_owned_name' => 'Owned by :user',
|
||||
'meta_owned_name' => '拥有者 :user',
|
||||
'entity_select' => '实体选择',
|
||||
'images' => '图片',
|
||||
'my_recent_drafts' => '我最近的草稿',
|
||||
@@ -40,7 +40,7 @@ return [
|
||||
'permissions_intro' => '本设置优先于每个用户角色本身所具有的权限。',
|
||||
'permissions_enable' => '启用自定义权限',
|
||||
'permissions_save' => '保存权限',
|
||||
'permissions_owner' => 'Owner',
|
||||
'permissions_owner' => '拥有者',
|
||||
|
||||
// Search
|
||||
'search_results' => '搜索结果',
|
||||
@@ -210,7 +210,7 @@ return [
|
||||
'pages_revisions' => '页面修订',
|
||||
'pages_revisions_named' => '“:pageName”页面修订',
|
||||
'pages_revision_named' => '“:pageName”页面修订',
|
||||
'pages_revision_restored_from' => 'Restored from #:id; :summary',
|
||||
'pages_revision_restored_from' => '从 #:id; :summary 恢复',
|
||||
'pages_revisions_created_by' => '创建者',
|
||||
'pages_revisions_date' => '修订日期',
|
||||
'pages_revisions_number' => '#',
|
||||
@@ -308,7 +308,7 @@ return [
|
||||
'comment_deleted_success' => '评论已删除',
|
||||
'comment_created_success' => '评论已添加',
|
||||
'comment_updated_success' => '评论已更新',
|
||||
'comment_delete_confirm' => '你确定要删除这条评论?',
|
||||
'comment_delete_confirm' => '您确定要删除这条评论?',
|
||||
'comment_in_reply_to' => '回复 :commentId',
|
||||
|
||||
// Revision
|
||||
|
||||
@@ -79,13 +79,13 @@ return [
|
||||
'maint_send_test_email_success' => '电子邮件已发送至 :address',
|
||||
'maint_send_test_email_mail_subject' => '测试电子邮件',
|
||||
'maint_send_test_email_mail_greeting' => '邮件发送功能看起来工作正常!',
|
||||
'maint_send_test_email_mail_text' => '恭喜!您收到了此邮件通知,你的电子邮件设置看起来配置正确。',
|
||||
'maint_recycle_bin_desc' => '被删除的书架、书籍、章节和页面会被存入回收站,你可以还原或永久删除它们。回收站中的较旧项目可能会在系统设置的一段时间后自动删除。',
|
||||
'maint_send_test_email_mail_text' => '恭喜!您收到了此邮件通知,您的电子邮件设置看起来已配置正确。',
|
||||
'maint_recycle_bin_desc' => '被删除的书架、书籍、章节和页面会被存入回收站,您可以还原或永久删除它们。回收站中较旧的项目可能会在系统设置的一段时间后被自动删除。',
|
||||
'maint_recycle_bin_open' => '打开回收站',
|
||||
|
||||
// Recycle Bin
|
||||
'recycle_bin' => '回收站',
|
||||
'recycle_bin_desc' => '在这里,您可以还原已删除的项目,或选择将其从系统中永久删除。与系统中应用了权限过滤器的类似活动列表不同,这个表是未经过滤的。',
|
||||
'recycle_bin_desc' => '在这里,您可以还原已删除的项目,或选择将其从系统中永久删除。与系统中过滤过的类似的活动记录不同,这个表会显示所有操作。',
|
||||
'recycle_bin_deleted_item' => '被删除的项目',
|
||||
'recycle_bin_deleted_by' => '删除者',
|
||||
'recycle_bin_deleted_at' => '删除时间',
|
||||
@@ -104,7 +104,7 @@ return [
|
||||
|
||||
// Audit Log
|
||||
'audit' => '审核日志',
|
||||
'audit_desc' => '该审核日志显示系统中跟踪的活动列表。与系统中应用了权限过滤器的类似活动列表不同,这个表是未经过滤的。',
|
||||
'audit_desc' => '这份审核日志显示所有被系统跟踪的活动。与系统中过滤过的类似的活动记录不同,这个表会显示所有操作。',
|
||||
'audit_event_filter' => '事件过滤器',
|
||||
'audit_event_filter_no_filter' => '无过滤器',
|
||||
'audit_deleted_item' => '被删除的项目',
|
||||
@@ -175,10 +175,10 @@ return [
|
||||
'users_delete_named' => '删除用户 :userName',
|
||||
'users_delete_warning' => '这将从系统中完全删除名为 \':userName\' 的用户。',
|
||||
'users_delete_confirm' => '您确定要删除这个用户?',
|
||||
'users_migrate_ownership' => 'Migrate Ownership',
|
||||
'users_migrate_ownership_desc' => 'Select a user here if you want another user to become the owner of all items currently owned by this user.',
|
||||
'users_none_selected' => 'No user selected',
|
||||
'users_delete_success' => 'User successfully removed',
|
||||
'users_migrate_ownership' => '迁移拥有权',
|
||||
'users_migrate_ownership_desc' => '如果您想要当前用户拥有的全部项目转移到另一个用户(更改拥有者),请在此处选择一个用户。',
|
||||
'users_none_selected' => '没有选中用户',
|
||||
'users_delete_success' => '已成功移除用户',
|
||||
'users_edit' => '编辑用户',
|
||||
'users_edit_profile' => '编辑资料',
|
||||
'users_edit_success' => '用户更新成功',
|
||||
@@ -239,7 +239,7 @@ return [
|
||||
'ja' => '日本語',
|
||||
'ko' => '한국어',
|
||||
'nl' => 'Nederlands',
|
||||
'nb' => 'Norsk (Bokmål)',
|
||||
'nb' => '挪威语 (Bokmål)',
|
||||
'pl' => 'Polski',
|
||||
'pt_BR' => 'Português do Brasil',
|
||||
'ru' => 'Русский',
|
||||
|
||||
@@ -22,7 +22,7 @@ return [
|
||||
'meta_created_name' => '由 :user 建立於 :timeLength',
|
||||
'meta_updated' => '更新於 :timeLength',
|
||||
'meta_updated_name' => '由 :user 更新於 :timeLength',
|
||||
'meta_owned_name' => 'Owned by :user',
|
||||
'meta_owned_name' => ':user 所擁有',
|
||||
'entity_select' => '選擇項目',
|
||||
'images' => '圖片',
|
||||
'my_recent_drafts' => '我最近的草稿',
|
||||
@@ -40,7 +40,7 @@ return [
|
||||
'permissions_intro' => '本設定優先權高於每個使用者角色本身所具有的權限。',
|
||||
'permissions_enable' => '啟用自訂權限',
|
||||
'permissions_save' => '儲存權限',
|
||||
'permissions_owner' => 'Owner',
|
||||
'permissions_owner' => '擁有者',
|
||||
|
||||
// Search
|
||||
'search_results' => '搜尋結果',
|
||||
@@ -217,7 +217,7 @@ return [
|
||||
'pages_revisions_numbered' => '修訂編號:id',
|
||||
'pages_revisions_numbered_changes' => '修訂編號:id 更改',
|
||||
'pages_revisions_changelog' => '更新說明',
|
||||
'pages_revisions_changes' => '說明',
|
||||
'pages_revisions_changes' => '更新紀錄',
|
||||
'pages_revisions_current' => '目前版本',
|
||||
'pages_revisions_preview' => '預覽',
|
||||
'pages_revisions_restore' => '恢複',
|
||||
|
||||
@@ -28,6 +28,7 @@ table.table {
|
||||
padding: $-s $-s;
|
||||
vertical-align: middle;
|
||||
margin: 0;
|
||||
overflow: visible;
|
||||
}
|
||||
th {
|
||||
font-weight: bold;
|
||||
|
||||
@@ -3,10 +3,8 @@
|
||||
@section('body')
|
||||
<div class="container small">
|
||||
|
||||
<div class="grid left-focus v-center no-row-gap">
|
||||
<div class="py-m">
|
||||
@include('settings.navbar', ['selected' => 'maintenance'])
|
||||
</div>
|
||||
<div class="py-m">
|
||||
@include('settings.navbar', ['selected' => 'maintenance'])
|
||||
</div>
|
||||
|
||||
<div class="card content-wrap auto-height">
|
||||
|
||||
@@ -3,10 +3,8 @@
|
||||
@section('body')
|
||||
<div class="container">
|
||||
|
||||
<div class="grid left-focus v-center no-row-gap">
|
||||
<div class="py-m">
|
||||
@include('settings.navbar', ['selected' => 'maintenance'])
|
||||
</div>
|
||||
<div class="py-m">
|
||||
@include('settings.navbar', ['selected' => 'maintenance'])
|
||||
</div>
|
||||
|
||||
<div class="card content-wrap auto-height">
|
||||
@@ -41,10 +39,10 @@
|
||||
|
||||
<table class="table">
|
||||
<tr>
|
||||
<th>{{ trans('settings.recycle_bin_deleted_item') }}</th>
|
||||
<th>{{ trans('settings.recycle_bin_deleted_by') }}</th>
|
||||
<th>{{ trans('settings.recycle_bin_deleted_at') }}</th>
|
||||
<th></th>
|
||||
<th width="50%">{{ trans('settings.recycle_bin_deleted_item') }}</th>
|
||||
<th width="20%">{{ trans('settings.recycle_bin_deleted_by') }}</th>
|
||||
<th width="15%">{{ trans('settings.recycle_bin_deleted_at') }}</th>
|
||||
<th width="15%"></th>
|
||||
</tr>
|
||||
@if(count($deletions) === 0)
|
||||
<tr>
|
||||
|
||||
@@ -3,10 +3,8 @@
|
||||
@section('body')
|
||||
<div class="container small">
|
||||
|
||||
<div class="grid left-focus v-center no-row-gap">
|
||||
<div class="py-m">
|
||||
@include('settings.navbar', ['selected' => 'maintenance'])
|
||||
</div>
|
||||
<div class="py-m">
|
||||
@include('settings.navbar', ['selected' => 'maintenance'])
|
||||
</div>
|
||||
|
||||
<div class="card content-wrap auto-height">
|
||||
|
||||
@@ -420,4 +420,45 @@ class PageContentTest extends TestCase
|
||||
$page->refresh();
|
||||
$this->assertEquals('"Hello & welcome"', $page->text);
|
||||
}
|
||||
|
||||
public function test_page_markdown_table_rendering()
|
||||
{
|
||||
$this->asEditor();
|
||||
$page = Page::query()->first();
|
||||
|
||||
$content = '| Syntax | Description |
|
||||
| ----------- | ----------- |
|
||||
| Header | Title |
|
||||
| Paragraph | Text |';
|
||||
$this->put($page->getUrl(), [
|
||||
'name' => $page->name, 'markdown' => $content,
|
||||
'html' => '', 'summary' => ''
|
||||
]);
|
||||
|
||||
$page->refresh();
|
||||
$this->assertStringContainsString('</tbody>', $page->html);
|
||||
|
||||
$pageView = $this->get($page->getUrl());
|
||||
$pageView->assertElementExists('.page-content table tbody td');
|
||||
}
|
||||
|
||||
public function test_page_markdown_task_list_rendering()
|
||||
{
|
||||
$this->asEditor();
|
||||
$page = Page::query()->first();
|
||||
|
||||
$content = '- [ ] Item a
|
||||
- [x] Item b';
|
||||
$this->put($page->getUrl(), [
|
||||
'name' => $page->name, 'markdown' => $content,
|
||||
'html' => '', 'summary' => ''
|
||||
]);
|
||||
|
||||
$page->refresh();
|
||||
$this->assertStringContainsString('input', $page->html);
|
||||
$this->assertStringContainsString('type="checkbox"', $page->html);
|
||||
|
||||
$pageView = $this->get($page->getUrl());
|
||||
$pageView->assertElementExists('.page-content input[type=checkbox]');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +1,40 @@
|
||||
<?php namespace Tests\Entity;
|
||||
|
||||
use BookStack\Entities\Models\Book;
|
||||
use BookStack\Entities\Models\Page;
|
||||
use Tests\TestCase;
|
||||
|
||||
class PageTest extends TestCase
|
||||
{
|
||||
public function test_page_creation_with_markdown_content()
|
||||
{
|
||||
$this->setSettings(['app-editor' => 'markdown']);
|
||||
$book = Book::query()->first();
|
||||
|
||||
$this->asEditor()->get($book->getUrl('/create-page'));
|
||||
$draft = Page::query()->where('book_id', '=', $book->id)
|
||||
->where('draft', '=', true)->first();
|
||||
|
||||
$details = [
|
||||
'markdown' => '# a title',
|
||||
'html' => '<h1>a title</h1>',
|
||||
'name' => 'my page',
|
||||
];
|
||||
$resp = $this->post($book->getUrl("/draft/{$draft->id}"), $details);
|
||||
$resp->assertRedirect();
|
||||
|
||||
$this->assertDatabaseHas('pages', [
|
||||
'markdown' => $details['markdown'],
|
||||
'name' => $details['name'],
|
||||
'id' => $draft->id,
|
||||
'draft' => false
|
||||
]);
|
||||
|
||||
$draft->refresh();
|
||||
$resp = $this->get($draft->getUrl("/edit"));
|
||||
$resp->assertSee("# a title");
|
||||
}
|
||||
|
||||
public function test_page_delete()
|
||||
{
|
||||
$page = Page::query()->first();
|
||||
@@ -24,4 +54,95 @@ class PageTest extends TestCase
|
||||
$redirectReq = $this->get($deleteReq->baseResponse->headers->get('location'));
|
||||
$redirectReq->assertNotificationContains('Page Successfully Deleted');
|
||||
}
|
||||
|
||||
public function test_page_copy()
|
||||
{
|
||||
$page = Page::first();
|
||||
$page->html = '<p>This is some test content</p>';
|
||||
$page->save();
|
||||
|
||||
$currentBook = $page->book;
|
||||
$newBook = Book::where('id', '!=', $currentBook->id)->first();
|
||||
|
||||
$resp = $this->asEditor()->get($page->getUrl('/copy'));
|
||||
$resp->assertSee('Copy Page');
|
||||
|
||||
$movePageResp = $this->post($page->getUrl('/copy'), [
|
||||
'entity_selection' => 'book:' . $newBook->id,
|
||||
'name' => 'My copied test page'
|
||||
]);
|
||||
$pageCopy = Page::where('name', '=', 'My copied test page')->first();
|
||||
|
||||
$movePageResp->assertRedirect($pageCopy->getUrl());
|
||||
$this->assertTrue($pageCopy->book->id == $newBook->id, 'Page was copied to correct book');
|
||||
$this->assertStringContainsString('This is some test content', $pageCopy->html);
|
||||
}
|
||||
|
||||
public function test_page_copy_with_markdown_has_both_html_and_markdown()
|
||||
{
|
||||
$page = Page::first();
|
||||
$page->html = '<h1>This is some test content</h1>';
|
||||
$page->markdown = '# This is some test content';
|
||||
$page->save();
|
||||
$newBook = Book::where('id', '!=', $page->book->id)->first();
|
||||
|
||||
$this->asEditor()->post($page->getUrl('/copy'), [
|
||||
'entity_selection' => 'book:' . $newBook->id,
|
||||
'name' => 'My copied test page'
|
||||
]);
|
||||
$pageCopy = Page::where('name', '=', 'My copied test page')->first();
|
||||
|
||||
$this->assertStringContainsString('This is some test content', $pageCopy->html);
|
||||
$this->assertEquals('# This is some test content', $pageCopy->markdown);
|
||||
}
|
||||
|
||||
public function test_page_copy_with_no_destination()
|
||||
{
|
||||
$page = Page::first();
|
||||
$currentBook = $page->book;
|
||||
|
||||
$resp = $this->asEditor()->get($page->getUrl('/copy'));
|
||||
$resp->assertSee('Copy Page');
|
||||
|
||||
$movePageResp = $this->post($page->getUrl('/copy'), [
|
||||
'name' => 'My copied test page'
|
||||
]);
|
||||
|
||||
$pageCopy = Page::where('name', '=', 'My copied test page')->first();
|
||||
|
||||
$movePageResp->assertRedirect($pageCopy->getUrl());
|
||||
$this->assertTrue($pageCopy->book->id == $currentBook->id, 'Page was copied to correct book');
|
||||
$this->assertTrue($pageCopy->id !== $page->id, 'Page copy is not the same instance');
|
||||
}
|
||||
|
||||
public function test_page_can_be_copied_without_edit_permission()
|
||||
{
|
||||
$page = Page::first();
|
||||
$currentBook = $page->book;
|
||||
$newBook = Book::where('id', '!=', $currentBook->id)->first();
|
||||
$viewer = $this->getViewer();
|
||||
|
||||
$resp = $this->actingAs($viewer)->get($page->getUrl());
|
||||
$resp->assertDontSee($page->getUrl('/copy'));
|
||||
|
||||
$newBook->owned_by = $viewer->id;
|
||||
$newBook->save();
|
||||
$this->giveUserPermissions($viewer, ['page-create-own']);
|
||||
$this->regenEntityPermissions($newBook);
|
||||
|
||||
$resp = $this->actingAs($viewer)->get($page->getUrl());
|
||||
$resp->assertSee($page->getUrl('/copy'));
|
||||
|
||||
$movePageResp = $this->post($page->getUrl('/copy'), [
|
||||
'entity_selection' => 'book:' . $newBook->id,
|
||||
'name' => 'My copied test page'
|
||||
]);
|
||||
$movePageResp->assertRedirect();
|
||||
|
||||
$this->assertDatabaseHas('pages', [
|
||||
'name' => 'My copied test page',
|
||||
'created_by' => $viewer->id,
|
||||
'book_id' => $newBook->id,
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -239,73 +239,4 @@ class SortTest extends TestCase
|
||||
$checkResp->assertSee($newBook->name);
|
||||
}
|
||||
|
||||
public function test_page_copy()
|
||||
{
|
||||
$page = Page::first();
|
||||
$currentBook = $page->book;
|
||||
$newBook = Book::where('id', '!=', $currentBook->id)->first();
|
||||
|
||||
$resp = $this->asEditor()->get($page->getUrl('/copy'));
|
||||
$resp->assertSee('Copy Page');
|
||||
|
||||
$movePageResp = $this->post($page->getUrl('/copy'), [
|
||||
'entity_selection' => 'book:' . $newBook->id,
|
||||
'name' => 'My copied test page'
|
||||
]);
|
||||
$pageCopy = Page::where('name', '=', 'My copied test page')->first();
|
||||
|
||||
$movePageResp->assertRedirect($pageCopy->getUrl());
|
||||
$this->assertTrue($pageCopy->book->id == $newBook->id, 'Page was copied to correct book');
|
||||
}
|
||||
|
||||
public function test_page_copy_with_no_destination()
|
||||
{
|
||||
$page = Page::first();
|
||||
$currentBook = $page->book;
|
||||
|
||||
$resp = $this->asEditor()->get($page->getUrl('/copy'));
|
||||
$resp->assertSee('Copy Page');
|
||||
|
||||
$movePageResp = $this->post($page->getUrl('/copy'), [
|
||||
'name' => 'My copied test page'
|
||||
]);
|
||||
|
||||
$pageCopy = Page::where('name', '=', 'My copied test page')->first();
|
||||
|
||||
$movePageResp->assertRedirect($pageCopy->getUrl());
|
||||
$this->assertTrue($pageCopy->book->id == $currentBook->id, 'Page was copied to correct book');
|
||||
$this->assertTrue($pageCopy->id !== $page->id, 'Page copy is not the same instance');
|
||||
}
|
||||
|
||||
public function test_page_can_be_copied_without_edit_permission()
|
||||
{
|
||||
$page = Page::first();
|
||||
$currentBook = $page->book;
|
||||
$newBook = Book::where('id', '!=', $currentBook->id)->first();
|
||||
$viewer = $this->getViewer();
|
||||
|
||||
$resp = $this->actingAs($viewer)->get($page->getUrl());
|
||||
$resp->assertDontSee($page->getUrl('/copy'));
|
||||
|
||||
$newBook->owned_by = $viewer->id;
|
||||
$newBook->save();
|
||||
$this->giveUserPermissions($viewer, ['page-create-own']);
|
||||
$this->regenEntityPermissions($newBook);
|
||||
|
||||
$resp = $this->actingAs($viewer)->get($page->getUrl());
|
||||
$resp->assertSee($page->getUrl('/copy'));
|
||||
|
||||
$movePageResp = $this->post($page->getUrl('/copy'), [
|
||||
'entity_selection' => 'book:' . $newBook->id,
|
||||
'name' => 'My copied test page'
|
||||
]);
|
||||
$movePageResp->assertRedirect();
|
||||
|
||||
$this->assertDatabaseHas('pages', [
|
||||
'name' => 'My copied test page',
|
||||
'created_by' => $viewer->id,
|
||||
'book_id' => $newBook->id,
|
||||
]);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -216,15 +216,23 @@ class RolesTest extends BrowserKitTest
|
||||
{
|
||||
$otherUsersPage = Page::first();
|
||||
$content = $this->createEntityChainBelongingToUser($this->user);
|
||||
|
||||
// Set a different creator on the page we're checking to ensure
|
||||
// that the owner fields are checked
|
||||
$page = $content['page']; /** @var Page $page */
|
||||
$page->created_by = $otherUsersPage->id;
|
||||
$page->owned_by = $this->user->id;
|
||||
$page->save();
|
||||
|
||||
// Check can't restrict other's content
|
||||
$this->actingAs($this->user)->visit($otherUsersPage->getUrl())
|
||||
->dontSee('Permissions')
|
||||
->visit($otherUsersPage->getUrl() . '/permissions')
|
||||
->seePageIs('/');
|
||||
// Check can't restrict own content
|
||||
$this->actingAs($this->user)->visit($content['page']->getUrl())
|
||||
$this->actingAs($this->user)->visit($page->getUrl())
|
||||
->dontSee('Permissions')
|
||||
->visit($content['page']->getUrl() . '/permissions')
|
||||
->visit($page->getUrl() . '/permissions')
|
||||
->seePageIs('/');
|
||||
|
||||
$this->giveUserPermissions($this->user, ['restrictions-manage-own']);
|
||||
@@ -235,10 +243,10 @@ class RolesTest extends BrowserKitTest
|
||||
->visit($otherUsersPage->getUrl() . '/permissions')
|
||||
->seePageIs('/');
|
||||
// Check can restrict own content
|
||||
$this->actingAs($this->user)->visit($content['page']->getUrl())
|
||||
$this->actingAs($this->user)->visit($page->getUrl())
|
||||
->see('Permissions')
|
||||
->click('Permissions')
|
||||
->seePageIs($content['page']->getUrl() . '/permissions');
|
||||
->seePageIs($page->getUrl() . '/permissions');
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
<?php namespace Tests\Uploads;
|
||||
|
||||
use BookStack\Auth\User;
|
||||
use BookStack\Exceptions\HttpFetchException;
|
||||
use BookStack\Uploads\HttpFetcher;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use Tests\TestCase;
|
||||
|
||||
class AvatarTest extends TestCase
|
||||
@@ -11,7 +13,7 @@ class AvatarTest extends TestCase
|
||||
|
||||
protected function createUserRequest($user)
|
||||
{
|
||||
$resp = $this->asAdmin()->post('/settings/users/create', [
|
||||
$this->asAdmin()->post('/settings/users/create', [
|
||||
'name' => $user->name,
|
||||
'email' => $user->email,
|
||||
'password' => 'testing',
|
||||
@@ -22,8 +24,7 @@ class AvatarTest extends TestCase
|
||||
|
||||
protected function assertImageFetchFrom(string $url)
|
||||
{
|
||||
$http = \Mockery::mock(HttpFetcher::class);
|
||||
$this->app->instance(HttpFetcher::class, $http);
|
||||
$http = $this->mock(HttpFetcher::class);
|
||||
|
||||
$http->shouldReceive('fetch')
|
||||
->once()->with($url)
|
||||
@@ -55,6 +56,7 @@ class AvatarTest extends TestCase
|
||||
public function test_custom_url_used_if_set()
|
||||
{
|
||||
config()->set([
|
||||
'services.disable_services' => false,
|
||||
'services.avatar_url' => 'https://example.com/${email}/${hash}/${size}',
|
||||
]);
|
||||
|
||||
@@ -74,11 +76,26 @@ class AvatarTest extends TestCase
|
||||
|
||||
$user = factory(User::class)->make();
|
||||
|
||||
$http = \Mockery::mock(HttpFetcher::class);
|
||||
$this->app->instance(HttpFetcher::class, $http);
|
||||
$http = $this->mock(HttpFetcher::class);
|
||||
$http->shouldNotReceive('fetch');
|
||||
|
||||
$this->createUserRequest($user);
|
||||
}
|
||||
|
||||
public function test_no_failure_but_error_logged_on_failed_avatar_fetch()
|
||||
{
|
||||
config()->set([
|
||||
'services.disable_services' => false,
|
||||
]);
|
||||
|
||||
$http = $this->mock(HttpFetcher::class);
|
||||
$http->shouldReceive('fetch')->andThrow(new HttpFetchException());
|
||||
|
||||
$logger = $this->withTestLogger();
|
||||
|
||||
$user = factory(User::class)->make();
|
||||
$this->createUserRequest($user);
|
||||
$this->assertTrue($logger->hasError('Failed to save user avatar image'));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user