Merge branch 'development' into release
This commit is contained in:
commit
f96b0ea5f3
|
@ -109,15 +109,35 @@ class PageContent
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Convert all inline base64 content to uploaded image files.
|
* Convert all inline base64 content to uploaded image files.
|
||||||
|
* Regex is used to locate the start of data-uri definitions then
|
||||||
|
* manual looping over content is done to parse the whole data uri.
|
||||||
|
* Attempting to capture the whole data uri using regex can cause PHP
|
||||||
|
* PCRE limits to be hit with larger, multi-MB, files.
|
||||||
*/
|
*/
|
||||||
protected function extractBase64ImagesFromMarkdown(string $markdown)
|
protected function extractBase64ImagesFromMarkdown(string $markdown)
|
||||||
{
|
{
|
||||||
$matches = [];
|
$matches = [];
|
||||||
preg_match_all('/!\[.*?]\(.*?(data:image\/.*?)[)"\s]/', $markdown, $matches);
|
$contentLength = strlen($markdown);
|
||||||
|
$replacements = [];
|
||||||
|
preg_match_all('/!\[.*?]\(.*?(data:image\/.{1,6};base64,)/', $markdown, $matches, PREG_OFFSET_CAPTURE);
|
||||||
|
|
||||||
foreach ($matches[1] as $base64Match) {
|
foreach ($matches[1] as $base64MatchPair) {
|
||||||
$newUrl = $this->base64ImageUriToUploadedImageUrl($base64Match);
|
[$dataUri, $index] = $base64MatchPair;
|
||||||
$markdown = str_replace($base64Match, $newUrl, $markdown);
|
|
||||||
|
for ($i = strlen($dataUri) + $index; $i < $contentLength; $i++) {
|
||||||
|
$char = $markdown[$i];
|
||||||
|
if ($char === ')' || $char === ' ' || $char === "\n" || $char === '"') {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
$dataUri .= $char;
|
||||||
|
}
|
||||||
|
|
||||||
|
$newUrl = $this->base64ImageUriToUploadedImageUrl($dataUri);
|
||||||
|
$replacements[] = [$dataUri, $newUrl];
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach ($replacements as [$dataUri, $newUrl]) {
|
||||||
|
$markdown = str_replace($dataUri, $newUrl, $markdown);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $markdown;
|
return $markdown;
|
||||||
|
|
|
@ -136,18 +136,14 @@ function codePlugin() {
|
||||||
const selectedNode = editor.selection.getNode();
|
const selectedNode = editor.selection.getNode();
|
||||||
|
|
||||||
if (!elemIsCodeBlock(selectedNode)) {
|
if (!elemIsCodeBlock(selectedNode)) {
|
||||||
const providedCode = editor.selection.getNode().textContent;
|
const providedCode = editor.selection.getContent({format: 'text'});
|
||||||
window.components.first('code-editor').open(providedCode, '', (code, lang) => {
|
window.components.first('code-editor').open(providedCode, '', (code, lang) => {
|
||||||
const wrap = document.createElement('div');
|
const wrap = document.createElement('div');
|
||||||
wrap.innerHTML = `<pre><code class="language-${lang}"></code></pre>`;
|
wrap.innerHTML = `<pre><code class="language-${lang}"></code></pre>`;
|
||||||
wrap.querySelector('code').innerText = code;
|
wrap.querySelector('code').innerText = code;
|
||||||
|
|
||||||
editor.formatter.toggle('pre');
|
editor.insertContent(wrap.innerHTML);
|
||||||
const node = editor.selection.getNode();
|
editor.focus();
|
||||||
editor.dom.setHTML(node, wrap.querySelector('pre').innerHTML);
|
|
||||||
editor.fire('SetContent');
|
|
||||||
|
|
||||||
editor.focus()
|
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,6 +32,7 @@ return [
|
||||||
'digits_between' => 'يجب أن يكون :attribute بعدد خانات بين :min و :max.',
|
'digits_between' => 'يجب أن يكون :attribute بعدد خانات بين :min و :max.',
|
||||||
'email' => 'يجب أن يكون :attribute عنوان بريد إلكتروني صالح.',
|
'email' => 'يجب أن يكون :attribute عنوان بريد إلكتروني صالح.',
|
||||||
'ends_with' => 'يجب أن تنتهي السمة بأحد القيم التالية',
|
'ends_with' => 'يجب أن تنتهي السمة بأحد القيم التالية',
|
||||||
|
'file' => 'The :attribute must be provided as a valid file.',
|
||||||
'filled' => 'حقل :attribute مطلوب.',
|
'filled' => 'حقل :attribute مطلوب.',
|
||||||
'gt' => [
|
'gt' => [
|
||||||
'numeric' => 'يجب أن تكون السمة أكبر من: القيمة.',
|
'numeric' => 'يجب أن تكون السمة أكبر من: القيمة.',
|
||||||
|
|
|
@ -32,6 +32,7 @@ return [
|
||||||
'digits_between' => ':attribute трябва да бъде с дължина между :min и :max цифри.',
|
'digits_between' => ':attribute трябва да бъде с дължина между :min и :max цифри.',
|
||||||
'email' => ':attribute трябва да бъде валиден имейл адрес.',
|
'email' => ':attribute трябва да бъде валиден имейл адрес.',
|
||||||
'ends_with' => ':attribute трябва да свършва с един от следните символи: :values',
|
'ends_with' => ':attribute трябва да свършва с един от следните символи: :values',
|
||||||
|
'file' => 'The :attribute must be provided as a valid file.',
|
||||||
'filled' => 'Полето :attribute е задължителен.',
|
'filled' => 'Полето :attribute е задължителен.',
|
||||||
'gt' => [
|
'gt' => [
|
||||||
'numeric' => ':attribute трябва да бъде по-голям от :value.',
|
'numeric' => ':attribute трябва да бъде по-голям от :value.',
|
||||||
|
|
|
@ -32,6 +32,7 @@ return [
|
||||||
'digits_between' => ':attribute mora imati između :min i :max brojeva.',
|
'digits_between' => ':attribute mora imati između :min i :max brojeva.',
|
||||||
'email' => ':attribute mora biti ispravna e-mail adresa.',
|
'email' => ':attribute mora biti ispravna e-mail adresa.',
|
||||||
'ends_with' => ':attribute mora završavati sa jednom od sljedećih: :values',
|
'ends_with' => ':attribute mora završavati sa jednom od sljedećih: :values',
|
||||||
|
'file' => 'The :attribute must be provided as a valid file.',
|
||||||
'filled' => 'Polje :attribute je obavezno.',
|
'filled' => 'Polje :attribute je obavezno.',
|
||||||
'gt' => [
|
'gt' => [
|
||||||
'numeric' => ':attribute mora biti veći od :value.',
|
'numeric' => ':attribute mora biti veći od :value.',
|
||||||
|
|
|
@ -32,6 +32,7 @@ return [
|
||||||
'digits_between' => 'El camp :attribute ha de tenir entre :min i :max dígits.',
|
'digits_between' => 'El camp :attribute ha de tenir entre :min i :max dígits.',
|
||||||
'email' => 'El camp :attribute ha de ser una adreça electrònica vàlida.',
|
'email' => 'El camp :attribute ha de ser una adreça electrònica vàlida.',
|
||||||
'ends_with' => 'El camp :attribute ha d\'acabar amb un dels següents valors: :values',
|
'ends_with' => 'El camp :attribute ha d\'acabar amb un dels següents valors: :values',
|
||||||
|
'file' => 'The :attribute must be provided as a valid file.',
|
||||||
'filled' => 'El camp :attribute és obligatori.',
|
'filled' => 'El camp :attribute és obligatori.',
|
||||||
'gt' => [
|
'gt' => [
|
||||||
'numeric' => 'El camp :attribute ha de ser més gran que :value.',
|
'numeric' => 'El camp :attribute ha de ser més gran que :value.',
|
||||||
|
|
|
@ -32,6 +32,7 @@ return [
|
||||||
'digits_between' => ':attribute musí být dlouhé nejméně :min a nejvíce :max pozic.',
|
'digits_between' => ':attribute musí být dlouhé nejméně :min a nejvíce :max pozic.',
|
||||||
'email' => ':attribute není platný formát.',
|
'email' => ':attribute není platný formát.',
|
||||||
'ends_with' => ':attribute musí končit jednou z následujících hodnot: :values',
|
'ends_with' => ':attribute musí končit jednou z následujících hodnot: :values',
|
||||||
|
'file' => 'The :attribute must be provided as a valid file.',
|
||||||
'filled' => ':attribute musí být vyplněno.',
|
'filled' => ':attribute musí být vyplněno.',
|
||||||
'gt' => [
|
'gt' => [
|
||||||
'numeric' => ':attribute musí být větší než :value.',
|
'numeric' => ':attribute musí být větší než :value.',
|
||||||
|
|
|
@ -32,6 +32,7 @@ return [
|
||||||
'digits_between' => ':attribute skal være mellem :min og :max cifre.',
|
'digits_between' => ':attribute skal være mellem :min og :max cifre.',
|
||||||
'email' => ':attribute skal være en gyldig mail-adresse.',
|
'email' => ':attribute skal være en gyldig mail-adresse.',
|
||||||
'ends_with' => ':attribute skal slutte på en af følgende værdier: :values',
|
'ends_with' => ':attribute skal slutte på en af følgende værdier: :values',
|
||||||
|
'file' => 'The :attribute must be provided as a valid file.',
|
||||||
'filled' => ':attribute er obligatorisk.',
|
'filled' => ':attribute er obligatorisk.',
|
||||||
'gt' => [
|
'gt' => [
|
||||||
'numeric' => ':attribute skal være større end :value.',
|
'numeric' => ':attribute skal være større end :value.',
|
||||||
|
|
|
@ -32,6 +32,7 @@ return [
|
||||||
'digits_between' => ':attribute muss zwischen :min und :max Stellen haben.',
|
'digits_between' => ':attribute muss zwischen :min und :max Stellen haben.',
|
||||||
'email' => ':attribute muss eine valide E-Mail-Adresse sein.',
|
'email' => ':attribute muss eine valide E-Mail-Adresse sein.',
|
||||||
'ends_with' => ':attribute muss mit einem der folgenden Werte: :values enden',
|
'ends_with' => ':attribute muss mit einem der folgenden Werte: :values enden',
|
||||||
|
'file' => 'The :attribute must be provided as a valid file.',
|
||||||
'filled' => ':attribute ist erforderlich.',
|
'filled' => ':attribute ist erforderlich.',
|
||||||
'gt' => [
|
'gt' => [
|
||||||
'numeric' => ':attribute muss größer als :value sein.',
|
'numeric' => ':attribute muss größer als :value sein.',
|
||||||
|
|
|
@ -32,6 +32,7 @@ return [
|
||||||
'digits_between' => ':attribute muss zwischen :min und :max Stellen haben.',
|
'digits_between' => ':attribute muss zwischen :min und :max Stellen haben.',
|
||||||
'email' => ':attribute muss eine valide E-Mail-Adresse sein.',
|
'email' => ':attribute muss eine valide E-Mail-Adresse sein.',
|
||||||
'ends_with' => ':attribute muss mit einem der folgenden Werte: :values enden',
|
'ends_with' => ':attribute muss mit einem der folgenden Werte: :values enden',
|
||||||
|
'file' => 'The :attribute must be provided as a valid file.',
|
||||||
'filled' => ':attribute ist erforderlich.',
|
'filled' => ':attribute ist erforderlich.',
|
||||||
'gt' => [
|
'gt' => [
|
||||||
'numeric' => ':attribute muss größer als :value sein.',
|
'numeric' => ':attribute muss größer als :value sein.',
|
||||||
|
|
|
@ -32,6 +32,7 @@ return [
|
||||||
'digits_between' => 'The :attribute must be between :min and :max digits.',
|
'digits_between' => 'The :attribute must be between :min and :max digits.',
|
||||||
'email' => 'The :attribute must be a valid email address.',
|
'email' => 'The :attribute must be a valid email address.',
|
||||||
'ends_with' => 'The :attribute must end with one of the following: :values',
|
'ends_with' => 'The :attribute must end with one of the following: :values',
|
||||||
|
'file' => 'The :attribute must be provided as a valid file.',
|
||||||
'filled' => 'The :attribute field is required.',
|
'filled' => 'The :attribute field is required.',
|
||||||
'gt' => [
|
'gt' => [
|
||||||
'numeric' => 'The :attribute must be greater than :value.',
|
'numeric' => 'The :attribute must be greater than :value.',
|
||||||
|
|
|
@ -32,6 +32,7 @@ return [
|
||||||
'digits_between' => ':attribute debe ser un valor entre :min y :max dígios.',
|
'digits_between' => ':attribute debe ser un valor entre :min y :max dígios.',
|
||||||
'email' => ':attribute debe ser un correo electrónico válido.',
|
'email' => ':attribute debe ser un correo electrónico válido.',
|
||||||
'ends_with' => 'El :attribute debe terminar con uno de los siguientes: :values',
|
'ends_with' => 'El :attribute debe terminar con uno de los siguientes: :values',
|
||||||
|
'file' => 'The :attribute must be provided as a valid file.',
|
||||||
'filled' => 'El campo :attribute es requerido.',
|
'filled' => 'El campo :attribute es requerido.',
|
||||||
'gt' => [
|
'gt' => [
|
||||||
'numeric' => 'El :attribute debe ser mayor que :value.',
|
'numeric' => 'El :attribute debe ser mayor que :value.',
|
||||||
|
|
|
@ -32,6 +32,7 @@ return [
|
||||||
'digits_between' => ':attribute debe ser un valor entre :min y :max dígios.',
|
'digits_between' => ':attribute debe ser un valor entre :min y :max dígios.',
|
||||||
'email' => ':attribute debe ser una dirección álida.',
|
'email' => ':attribute debe ser una dirección álida.',
|
||||||
'ends_with' => 'El :attribute debe terminar con uno de los siguientes: :values',
|
'ends_with' => 'El :attribute debe terminar con uno de los siguientes: :values',
|
||||||
|
'file' => 'The :attribute must be provided as a valid file.',
|
||||||
'filled' => 'El campo :attribute es requerido.',
|
'filled' => 'El campo :attribute es requerido.',
|
||||||
'gt' => [
|
'gt' => [
|
||||||
'numeric' => 'El :attribute debe ser mayor que :value.',
|
'numeric' => 'El :attribute debe ser mayor que :value.',
|
||||||
|
|
|
@ -32,6 +32,7 @@ return [
|
||||||
'digits_between' => ':attribute peab olema :min ja :max numbri vahel.',
|
'digits_between' => ':attribute peab olema :min ja :max numbri vahel.',
|
||||||
'email' => ':attribute peab olema kehtiv e-posti aadress.',
|
'email' => ':attribute peab olema kehtiv e-posti aadress.',
|
||||||
'ends_with' => ':attribute lõpus peab olema üks järgmistest väärtustest: :values',
|
'ends_with' => ':attribute lõpus peab olema üks järgmistest väärtustest: :values',
|
||||||
|
'file' => 'The :attribute must be provided as a valid file.',
|
||||||
'filled' => ':attribute väli on kohustuslik.',
|
'filled' => ':attribute väli on kohustuslik.',
|
||||||
'gt' => [
|
'gt' => [
|
||||||
'numeric' => ':attribute peab olema suurem kui :value.',
|
'numeric' => ':attribute peab olema suurem kui :value.',
|
||||||
|
|
|
@ -32,6 +32,7 @@ return [
|
||||||
'digits_between' => ':attribute باید بین :min و :max رقم باشد.',
|
'digits_between' => ':attribute باید بین :min و :max رقم باشد.',
|
||||||
'email' => ':attribute باید یک ایمیل معتبر باشد.',
|
'email' => ':attribute باید یک ایمیل معتبر باشد.',
|
||||||
'ends_with' => 'فیلد :attribute باید با یکی از مقادیر زیر خاتمه یابد: :values',
|
'ends_with' => 'فیلد :attribute باید با یکی از مقادیر زیر خاتمه یابد: :values',
|
||||||
|
'file' => 'The :attribute must be provided as a valid file.',
|
||||||
'filled' => 'فیلد :attribute باید مقدار داشته باشد.',
|
'filled' => 'فیلد :attribute باید مقدار داشته باشد.',
|
||||||
'gt' => [
|
'gt' => [
|
||||||
'numeric' => ':attribute باید بزرگتر از :value باشد.',
|
'numeric' => ':attribute باید بزرگتر از :value باشد.',
|
||||||
|
|
|
@ -75,7 +75,7 @@ return [
|
||||||
'status_active' => 'Actif',
|
'status_active' => 'Actif',
|
||||||
'status_inactive' => 'Inactif',
|
'status_inactive' => 'Inactif',
|
||||||
'never' => 'Jamais',
|
'never' => 'Jamais',
|
||||||
'none' => 'None',
|
'none' => 'Aucun',
|
||||||
|
|
||||||
// Header
|
// Header
|
||||||
'header_menu_expand' => 'Développer le menu',
|
'header_menu_expand' => 'Développer le menu',
|
||||||
|
|
|
@ -32,6 +32,7 @@ return [
|
||||||
'digits_between' => ':attribute doit avoir une longueur entre :min et :max.',
|
'digits_between' => ':attribute doit avoir une longueur entre :min et :max.',
|
||||||
'email' => ':attribute doit être une adresse e-mail valide.',
|
'email' => ':attribute doit être une adresse e-mail valide.',
|
||||||
'ends_with' => ':attribute doit se terminer par une des valeurs suivantes : :values',
|
'ends_with' => ':attribute doit se terminer par une des valeurs suivantes : :values',
|
||||||
|
'file' => 'The :attribute must be provided as a valid file.',
|
||||||
'filled' => ':attribute est un champ requis.',
|
'filled' => ':attribute est un champ requis.',
|
||||||
'gt' => [
|
'gt' => [
|
||||||
'numeric' => ':attribute doit être plus grand que :value.',
|
'numeric' => ':attribute doit être plus grand que :value.',
|
||||||
|
|
|
@ -32,6 +32,7 @@ return [
|
||||||
'digits_between' => 'שדה :attribute חייב להיות בין :min ו-:max ספרות.',
|
'digits_between' => 'שדה :attribute חייב להיות בין :min ו-:max ספרות.',
|
||||||
'email' => 'שדה :attribute חייב להיות כתובת אימייל תקנית.',
|
'email' => 'שדה :attribute חייב להיות כתובת אימייל תקנית.',
|
||||||
'ends_with' => 'The :attribute must end with one of the following: :values',
|
'ends_with' => 'The :attribute must end with one of the following: :values',
|
||||||
|
'file' => 'The :attribute must be provided as a valid file.',
|
||||||
'filled' => 'שדה :attribute הוא חובה.',
|
'filled' => 'שדה :attribute הוא חובה.',
|
||||||
'gt' => [
|
'gt' => [
|
||||||
'numeric' => 'The :attribute must be greater than :value.',
|
'numeric' => 'The :attribute must be greater than :value.',
|
||||||
|
|
|
@ -32,6 +32,7 @@ return [
|
||||||
'digits_between' => ':attribute mora biti između :min i :max znamenki.',
|
'digits_between' => ':attribute mora biti između :min i :max znamenki.',
|
||||||
'email' => ':attribute mora biti valjana email adresa.',
|
'email' => ':attribute mora biti valjana email adresa.',
|
||||||
'ends_with' => ':attribute mora završiti s :values',
|
'ends_with' => ':attribute mora završiti s :values',
|
||||||
|
'file' => 'The :attribute must be provided as a valid file.',
|
||||||
'filled' => ':attribute polje je obavezno.',
|
'filled' => ':attribute polje je obavezno.',
|
||||||
'gt' => [
|
'gt' => [
|
||||||
'numeric' => ':attribute mora biti veći od :value.',
|
'numeric' => ':attribute mora biti veći od :value.',
|
||||||
|
|
|
@ -32,6 +32,7 @@ return [
|
||||||
'digits_between' => ':attribute hosszának :min és :max számjegy között kell lennie.',
|
'digits_between' => ':attribute hosszának :min és :max számjegy között kell lennie.',
|
||||||
'email' => ':attribute érvényes email cím kell legyen.',
|
'email' => ':attribute érvényes email cím kell legyen.',
|
||||||
'ends_with' => ':attribute attribútumnak a következők egyikével kell végződnie: :values',
|
'ends_with' => ':attribute attribútumnak a következők egyikével kell végződnie: :values',
|
||||||
|
'file' => 'The :attribute must be provided as a valid file.',
|
||||||
'filled' => ':attribute mező kötelező.',
|
'filled' => ':attribute mező kötelező.',
|
||||||
'gt' => [
|
'gt' => [
|
||||||
'numeric' => ':attribute nagyobb kell, hogy legyen, mint :value.',
|
'numeric' => ':attribute nagyobb kell, hogy legyen, mint :value.',
|
||||||
|
|
|
@ -32,6 +32,7 @@ return [
|
||||||
'digits_between' => ':attribute harus diantara :min dan :max digit.',
|
'digits_between' => ':attribute harus diantara :min dan :max digit.',
|
||||||
'email' => ':attrtibute Harus alamat e-mail yang valid.',
|
'email' => ':attrtibute Harus alamat e-mail yang valid.',
|
||||||
'ends_with' => ':attribute harus diakhiri dengan salah satu dari berikut ini: :values',
|
'ends_with' => ':attribute harus diakhiri dengan salah satu dari berikut ini: :values',
|
||||||
|
'file' => 'The :attribute must be provided as a valid file.',
|
||||||
'filled' => ':attribute bidang diperlukan.',
|
'filled' => ':attribute bidang diperlukan.',
|
||||||
'gt' => [
|
'gt' => [
|
||||||
'numeric' => ':attribute harus lebih besar dari :value.',
|
'numeric' => ':attribute harus lebih besar dari :value.',
|
||||||
|
|
|
@ -32,6 +32,7 @@ return [
|
||||||
'digits_between' => 'Il campo :attribute deve essere tra i numeri :min e :max.',
|
'digits_between' => 'Il campo :attribute deve essere tra i numeri :min e :max.',
|
||||||
'email' => 'Il campo :attribute deve essere un indirizzo email valido.',
|
'email' => 'Il campo :attribute deve essere un indirizzo email valido.',
|
||||||
'ends_with' => ':attribute deve terminare con uno dei seguenti: :values',
|
'ends_with' => ':attribute deve terminare con uno dei seguenti: :values',
|
||||||
|
'file' => 'The :attribute must be provided as a valid file.',
|
||||||
'filled' => 'Il campo :attribute field is required.',
|
'filled' => 'Il campo :attribute field is required.',
|
||||||
'gt' => [
|
'gt' => [
|
||||||
'numeric' => ':attribute deve essere maggiore di :value.',
|
'numeric' => ':attribute deve essere maggiore di :value.',
|
||||||
|
|
|
@ -32,6 +32,7 @@ return [
|
||||||
'digits_between' => ':attributeは:min〜:maxである必要があります。',
|
'digits_between' => ':attributeは:min〜:maxである必要があります。',
|
||||||
'email' => ':attributeは正しいEメールアドレスである必要があります。',
|
'email' => ':attributeは正しいEメールアドレスである必要があります。',
|
||||||
'ends_with' => ':attributeは:valuesのいずれかで終わる必要があります。',
|
'ends_with' => ':attributeは:valuesのいずれかで終わる必要があります。',
|
||||||
|
'file' => 'The :attribute must be provided as a valid file.',
|
||||||
'filled' => ':attributeは必須です。',
|
'filled' => ':attributeは必須です。',
|
||||||
'gt' => [
|
'gt' => [
|
||||||
'numeric' => ':attributeは:valueより大きな値である必要があります。',
|
'numeric' => ':attributeは:valueより大きな値である必要があります。',
|
||||||
|
|
|
@ -32,6 +32,7 @@ return [
|
||||||
'digits_between' => ':attribute(을)를 :min~:max자리로 구성하세요.',
|
'digits_between' => ':attribute(을)를 :min~:max자리로 구성하세요.',
|
||||||
'email' => ':attribute(을)를 유효한 메일 주소로 구성하세요.',
|
'email' => ':attribute(을)를 유효한 메일 주소로 구성하세요.',
|
||||||
'ends_with' => ':attribute(을)를 :values(으)로 끝나게 구성하세요.',
|
'ends_with' => ':attribute(을)를 :values(으)로 끝나게 구성하세요.',
|
||||||
|
'file' => 'The :attribute must be provided as a valid file.',
|
||||||
'filled' => ':attribute(을)를 구성하세요.',
|
'filled' => ':attribute(을)를 구성하세요.',
|
||||||
'gt' => [
|
'gt' => [
|
||||||
'numeric' => ':attribute(을)를 :value(이)가 넘게 구성하세요.',
|
'numeric' => ':attribute(을)를 :value(이)가 넘게 구성하세요.',
|
||||||
|
|
|
@ -32,6 +32,7 @@ return [
|
||||||
'digits_between' => ':attribute turi būti tarp :min ir :max skaitmenų.',
|
'digits_between' => ':attribute turi būti tarp :min ir :max skaitmenų.',
|
||||||
'email' => ':attribute turi būti tinkamas elektroninio pašto adresas.',
|
'email' => ':attribute turi būti tinkamas elektroninio pašto adresas.',
|
||||||
'ends_with' => ':attribute turi pasibaigti vienu iš šių: :values',
|
'ends_with' => ':attribute turi pasibaigti vienu iš šių: :values',
|
||||||
|
'file' => 'The :attribute must be provided as a valid file.',
|
||||||
'filled' => ':attribute laukas yra privalomas.',
|
'filled' => ':attribute laukas yra privalomas.',
|
||||||
'gt' => [
|
'gt' => [
|
||||||
'numeric' => ':attribute turi būti didesnis negu :value.',
|
'numeric' => ':attribute turi būti didesnis negu :value.',
|
||||||
|
|
|
@ -74,8 +74,8 @@ return [
|
||||||
'status' => 'Statuss',
|
'status' => 'Statuss',
|
||||||
'status_active' => 'Aktīvs',
|
'status_active' => 'Aktīvs',
|
||||||
'status_inactive' => 'Neaktīvs',
|
'status_inactive' => 'Neaktīvs',
|
||||||
'never' => 'Never',
|
'never' => 'Nekad',
|
||||||
'none' => 'None',
|
'none' => 'Neviens',
|
||||||
|
|
||||||
// Header
|
// Header
|
||||||
'header_menu_expand' => 'Izvērst galvenes izvēlni',
|
'header_menu_expand' => 'Izvērst galvenes izvēlni',
|
||||||
|
|
|
@ -246,7 +246,7 @@ return [
|
||||||
'webhooks_events_warning' => 'Ņemiet vērā, ka šie notikumi tiks palaisti visiem izvēlētajiem notikumiem, pat ja norādītas pielāgotas piekļuves tiesības. Pārliecineities, ka webhook lietošana neatklās ierobežotas pieejamības saturu.',
|
'webhooks_events_warning' => 'Ņemiet vērā, ka šie notikumi tiks palaisti visiem izvēlētajiem notikumiem, pat ja norādītas pielāgotas piekļuves tiesības. Pārliecineities, ka webhook lietošana neatklās ierobežotas pieejamības saturu.',
|
||||||
'webhooks_events_all' => 'Visi sistēmas notikumi',
|
'webhooks_events_all' => 'Visi sistēmas notikumi',
|
||||||
'webhooks_name' => 'Webhook nosaukums',
|
'webhooks_name' => 'Webhook nosaukums',
|
||||||
'webhooks_timeout' => 'Webhook Request Timeout (Seconds)',
|
'webhooks_timeout' => 'Webhook pieprasījuma laika ierobežojums (sekundēs)',
|
||||||
'webhooks_endpoint' => 'Webhook adrese (endpoint)',
|
'webhooks_endpoint' => 'Webhook adrese (endpoint)',
|
||||||
'webhooks_active' => 'Webhook aktīvs',
|
'webhooks_active' => 'Webhook aktīvs',
|
||||||
'webhook_events_table_header' => 'Notikumi',
|
'webhook_events_table_header' => 'Notikumi',
|
||||||
|
@ -255,10 +255,10 @@ return [
|
||||||
'webhooks_delete_confirm' => 'Vai tiešām vēlaties dzēst šo webhook?',
|
'webhooks_delete_confirm' => 'Vai tiešām vēlaties dzēst šo webhook?',
|
||||||
'webhooks_format_example' => 'Webhook formāta piemērs',
|
'webhooks_format_example' => 'Webhook formāta piemērs',
|
||||||
'webhooks_format_example_desc' => 'Webhook dati tiek nosūtīti kā POST pieprasījums norādītajai endpoint adresei kā JSON tālāk norādītajā formātā. "related_item" un "url" īpašības nav obligātas un ir atkarīgas no palaistā notikuma veida.',
|
'webhooks_format_example_desc' => 'Webhook dati tiek nosūtīti kā POST pieprasījums norādītajai endpoint adresei kā JSON tālāk norādītajā formātā. "related_item" un "url" īpašības nav obligātas un ir atkarīgas no palaistā notikuma veida.',
|
||||||
'webhooks_status' => 'Webhook Status',
|
'webhooks_status' => 'Webhook statuss',
|
||||||
'webhooks_last_called' => 'Last Called:',
|
'webhooks_last_called' => 'Pēdejoreiz izsaukts:',
|
||||||
'webhooks_last_errored' => 'Last Errored:',
|
'webhooks_last_errored' => 'Pedējoreiz kļūda:',
|
||||||
'webhooks_last_error_message' => 'Last Error Message:',
|
'webhooks_last_error_message' => 'Pēdējais kļūdas paziņojums:',
|
||||||
|
|
||||||
|
|
||||||
//! If editing translations files directly please ignore this in all
|
//! If editing translations files directly please ignore this in all
|
||||||
|
|
|
@ -32,6 +32,7 @@ return [
|
||||||
'digits_between' => ':attribute jābūt starp :min un :max cipariem.',
|
'digits_between' => ':attribute jābūt starp :min un :max cipariem.',
|
||||||
'email' => ':attribute jābūt derīgai e-pasta adresei.',
|
'email' => ':attribute jābūt derīgai e-pasta adresei.',
|
||||||
'ends_with' => ':attribute jābeidzas ar vienu no :values',
|
'ends_with' => ':attribute jābeidzas ar vienu no :values',
|
||||||
|
'file' => 'The :attribute must be provided as a valid file.',
|
||||||
'filled' => ':attribute lauks ir obligāts.',
|
'filled' => ':attribute lauks ir obligāts.',
|
||||||
'gt' => [
|
'gt' => [
|
||||||
'numeric' => ':attribute jābūt lielākam kā :value.',
|
'numeric' => ':attribute jābūt lielākam kā :value.',
|
||||||
|
|
|
@ -32,6 +32,7 @@ return [
|
||||||
'digits_between' => ':attribute må være mellomg :min og :max tall.',
|
'digits_between' => ':attribute må være mellomg :min og :max tall.',
|
||||||
'email' => ':attribute må være en gyldig e-post.',
|
'email' => ':attribute må være en gyldig e-post.',
|
||||||
'ends_with' => ':attribute må slutte med en av verdiene: :values',
|
'ends_with' => ':attribute må slutte med en av verdiene: :values',
|
||||||
|
'file' => 'The :attribute must be provided as a valid file.',
|
||||||
'filled' => ':attribute feltet er påkrevd.',
|
'filled' => ':attribute feltet er påkrevd.',
|
||||||
'gt' => [
|
'gt' => [
|
||||||
'numeric' => ':attribute må være større enn :value.',
|
'numeric' => ':attribute må være større enn :value.',
|
||||||
|
|
|
@ -32,6 +32,7 @@ return [
|
||||||
'digits_between' => ':attribute moet tussen de :min en :max cijfers zijn.',
|
'digits_between' => ':attribute moet tussen de :min en :max cijfers zijn.',
|
||||||
'email' => ':attribute is geen geldig e-mailadres.',
|
'email' => ':attribute is geen geldig e-mailadres.',
|
||||||
'ends_with' => ':attribute moet eindigen met een van de volgende: :values',
|
'ends_with' => ':attribute moet eindigen met een van de volgende: :values',
|
||||||
|
'file' => 'The :attribute must be provided as a valid file.',
|
||||||
'filled' => ':attribute is verplicht.',
|
'filled' => ':attribute is verplicht.',
|
||||||
'gt' => [
|
'gt' => [
|
||||||
'numeric' => ':attribute moet groter zijn dan :value.',
|
'numeric' => ':attribute moet groter zijn dan :value.',
|
||||||
|
|
|
@ -32,6 +32,7 @@ return [
|
||||||
'digits_between' => ':attribute musi mieć od :min do :max cyfr.',
|
'digits_between' => ':attribute musi mieć od :min do :max cyfr.',
|
||||||
'email' => ':attribute musi być prawidłowym adresem e-mail.',
|
'email' => ':attribute musi być prawidłowym adresem e-mail.',
|
||||||
'ends_with' => ':attribute musi kończyć się jedną z poniższych wartości: :values',
|
'ends_with' => ':attribute musi kończyć się jedną z poniższych wartości: :values',
|
||||||
|
'file' => 'The :attribute must be provided as a valid file.',
|
||||||
'filled' => ':attribute jest wymagany.',
|
'filled' => ':attribute jest wymagany.',
|
||||||
'gt' => [
|
'gt' => [
|
||||||
'numeric' => ':attribute musi być większy niż :value.',
|
'numeric' => ':attribute musi być większy niż :value.',
|
||||||
|
|
|
@ -32,6 +32,7 @@ return [
|
||||||
'digits_between' => 'O campo :attribute deve ter entre :min e :max dígitos.',
|
'digits_between' => 'O campo :attribute deve ter entre :min e :max dígitos.',
|
||||||
'email' => 'O campo :attribute deve ser um endereço de e-mail válido.',
|
'email' => 'O campo :attribute deve ser um endereço de e-mail válido.',
|
||||||
'ends_with' => 'O campo :attribute deve terminar com um dos seguintes: :values',
|
'ends_with' => 'O campo :attribute deve terminar com um dos seguintes: :values',
|
||||||
|
'file' => 'The :attribute must be provided as a valid file.',
|
||||||
'filled' => 'O campo :attribute é requerido.',
|
'filled' => 'O campo :attribute é requerido.',
|
||||||
'gt' => [
|
'gt' => [
|
||||||
'numeric' => 'O campo :attribute deve ser maior que :value.',
|
'numeric' => 'O campo :attribute deve ser maior que :value.',
|
||||||
|
|
|
@ -32,6 +32,7 @@ return [
|
||||||
'digits_between' => 'O campo :attribute deve ter entre :min e :max dígitos.',
|
'digits_between' => 'O campo :attribute deve ter entre :min e :max dígitos.',
|
||||||
'email' => 'O campo :attribute deve ser um e-mail válido.',
|
'email' => 'O campo :attribute deve ser um e-mail válido.',
|
||||||
'ends_with' => 'O campo :attribute deve terminar com um dos seguintes: :values',
|
'ends_with' => 'O campo :attribute deve terminar com um dos seguintes: :values',
|
||||||
|
'file' => 'The :attribute must be provided as a valid file.',
|
||||||
'filled' => 'O campo :attribute é requerido.',
|
'filled' => 'O campo :attribute é requerido.',
|
||||||
'gt' => [
|
'gt' => [
|
||||||
'numeric' => 'O campo :attribute deve ser maior que :value.',
|
'numeric' => 'O campo :attribute deve ser maior que :value.',
|
||||||
|
|
|
@ -32,6 +32,7 @@ return [
|
||||||
'digits_between' => ':attribute должен иметь от :min до :max цифр.',
|
'digits_between' => ':attribute должен иметь от :min до :max цифр.',
|
||||||
'email' => ':attribute должен быть корректным email адресом.',
|
'email' => ':attribute должен быть корректным email адресом.',
|
||||||
'ends_with' => ':attribute должен заканчиваться одним из следующих: :values',
|
'ends_with' => ':attribute должен заканчиваться одним из следующих: :values',
|
||||||
|
'file' => 'The :attribute must be provided as a valid file.',
|
||||||
'filled' => ':attribute поле необходимо.',
|
'filled' => ':attribute поле необходимо.',
|
||||||
'gt' => [
|
'gt' => [
|
||||||
'numeric' => 'Значение :attribute должно быть больше чем :value.',
|
'numeric' => 'Значение :attribute должно быть больше чем :value.',
|
||||||
|
|
|
@ -32,6 +32,7 @@ return [
|
||||||
'digits_between' => ':attribute musí mať medzi :min a :max číslicami.',
|
'digits_between' => ':attribute musí mať medzi :min a :max číslicami.',
|
||||||
'email' => ':attribute musí byť platná emailová adresa.',
|
'email' => ':attribute musí byť platná emailová adresa.',
|
||||||
'ends_with' => ':attribute musí končiť jednou z nasledujúcich hodnôt :values',
|
'ends_with' => ':attribute musí končiť jednou z nasledujúcich hodnôt :values',
|
||||||
|
'file' => 'The :attribute must be provided as a valid file.',
|
||||||
'filled' => 'Políčko :attribute je povinné.',
|
'filled' => 'Políčko :attribute je povinné.',
|
||||||
'gt' => [
|
'gt' => [
|
||||||
'numeric' => 'Hodnota :attribute musí byť väčšia ako :value.',
|
'numeric' => 'Hodnota :attribute musí byť väčšia ako :value.',
|
||||||
|
|
|
@ -32,6 +32,7 @@ return [
|
||||||
'digits_between' => ':attribute mora biti med :min in :max števkami.',
|
'digits_between' => ':attribute mora biti med :min in :max števkami.',
|
||||||
'email' => ':attribute mora biti veljaven e-naslov.',
|
'email' => ':attribute mora biti veljaven e-naslov.',
|
||||||
'ends_with' => 'The :attribute se mora končati z eno od določenih: :vrednost/values',
|
'ends_with' => 'The :attribute se mora končati z eno od določenih: :vrednost/values',
|
||||||
|
'file' => 'The :attribute must be provided as a valid file.',
|
||||||
'filled' => 'Polje ne sme biti prazno.',
|
'filled' => 'Polje ne sme biti prazno.',
|
||||||
'gt' => [
|
'gt' => [
|
||||||
'numeric' => ':attribute mora biti večji kot :vrednost.',
|
'numeric' => ':attribute mora biti večji kot :vrednost.',
|
||||||
|
|
|
@ -32,6 +32,7 @@ return [
|
||||||
'digits_between' => ':attribute måste vara mellan :min och :max siffror.',
|
'digits_between' => ':attribute måste vara mellan :min och :max siffror.',
|
||||||
'email' => ':attribute måste vara en giltig e-postadress.',
|
'email' => ':attribute måste vara en giltig e-postadress.',
|
||||||
'ends_with' => ':attribute måste sluta med något av följande: :values',
|
'ends_with' => ':attribute måste sluta med något av följande: :values',
|
||||||
|
'file' => 'The :attribute must be provided as a valid file.',
|
||||||
'filled' => ':attribute är obligatoriskt.',
|
'filled' => ':attribute är obligatoriskt.',
|
||||||
'gt' => [
|
'gt' => [
|
||||||
'numeric' => ':attribute måste vara större än :value.',
|
'numeric' => ':attribute måste vara större än :value.',
|
||||||
|
|
|
@ -32,6 +32,7 @@ return [
|
||||||
'digits_between' => ':attribute, en az :min ve en fazla :max basamaklı olmalıdır.',
|
'digits_between' => ':attribute, en az :min ve en fazla :max basamaklı olmalıdır.',
|
||||||
'email' => ':attribute, geçerli bir e-posta adresi olmalıdır.',
|
'email' => ':attribute, geçerli bir e-posta adresi olmalıdır.',
|
||||||
'ends_with' => ':attribute, şunlardan birisiyle bitmelidir: :values',
|
'ends_with' => ':attribute, şunlardan birisiyle bitmelidir: :values',
|
||||||
|
'file' => 'The :attribute must be provided as a valid file.',
|
||||||
'filled' => ':attribute alanı zorunludur.',
|
'filled' => ':attribute alanı zorunludur.',
|
||||||
'gt' => [
|
'gt' => [
|
||||||
'numeric' => ':attribute, :max değerinden büyük olmalıdır.',
|
'numeric' => ':attribute, :max değerinden büyük olmalıdır.',
|
||||||
|
|
|
@ -32,6 +32,7 @@ return [
|
||||||
'digits_between' => 'Довжина цифрового поля :attribute повинна бути від :min до :max.',
|
'digits_between' => 'Довжина цифрового поля :attribute повинна бути від :min до :max.',
|
||||||
'email' => 'Поле :attribute повинне містити коректну електронну адресу.',
|
'email' => 'Поле :attribute повинне містити коректну електронну адресу.',
|
||||||
'ends_with' => 'Поле :attribute має закінчуватися одним з наступних значень: :values',
|
'ends_with' => 'Поле :attribute має закінчуватися одним з наступних значень: :values',
|
||||||
|
'file' => 'The :attribute must be provided as a valid file.',
|
||||||
'filled' => 'Поле :attribute є обов\'язковим для заповнення.',
|
'filled' => 'Поле :attribute є обов\'язковим для заповнення.',
|
||||||
'gt' => [
|
'gt' => [
|
||||||
'numeric' => 'Поле :attribute має бути більше ніж :value.',
|
'numeric' => 'Поле :attribute має бути більше ніж :value.',
|
||||||
|
|
|
@ -32,6 +32,7 @@ return [
|
||||||
'digits_between' => ':attribute phải có từ :min đến :max chữ số.',
|
'digits_between' => ':attribute phải có từ :min đến :max chữ số.',
|
||||||
'email' => ':attribute phải là địa chỉ email hợp lệ.',
|
'email' => ':attribute phải là địa chỉ email hợp lệ.',
|
||||||
'ends_with' => ':attribute phải kết thúc bằng một trong các ký tự: :values',
|
'ends_with' => ':attribute phải kết thúc bằng một trong các ký tự: :values',
|
||||||
|
'file' => 'The :attribute must be provided as a valid file.',
|
||||||
'filled' => 'Trường :attribute là bắt buộc.',
|
'filled' => 'Trường :attribute là bắt buộc.',
|
||||||
'gt' => [
|
'gt' => [
|
||||||
'numeric' => ':attribute phải lớn hơn :value.',
|
'numeric' => ':attribute phải lớn hơn :value.',
|
||||||
|
|
|
@ -75,7 +75,7 @@ return [
|
||||||
'status_active' => '已激活',
|
'status_active' => '已激活',
|
||||||
'status_inactive' => '未激活',
|
'status_inactive' => '未激活',
|
||||||
'never' => '从未',
|
'never' => '从未',
|
||||||
'none' => 'None',
|
'none' => '无',
|
||||||
|
|
||||||
// Header
|
// Header
|
||||||
'header_menu_expand' => '展开标头菜单',
|
'header_menu_expand' => '展开标头菜单',
|
||||||
|
|
|
@ -32,6 +32,7 @@ return [
|
||||||
'digits_between' => ':attribute 必须为:min到:max位数。',
|
'digits_between' => ':attribute 必须为:min到:max位数。',
|
||||||
'email' => ':attribute 必须是有效的电子邮件地址。',
|
'email' => ':attribute 必须是有效的电子邮件地址。',
|
||||||
'ends_with' => ' :attribute 必须以 :values 后缀结尾',
|
'ends_with' => ' :attribute 必须以 :values 后缀结尾',
|
||||||
|
'file' => 'The :attribute must be provided as a valid file.',
|
||||||
'filled' => ':attribute 字段是必需的。',
|
'filled' => ':attribute 字段是必需的。',
|
||||||
'gt' => [
|
'gt' => [
|
||||||
'numeric' => ':attribute必须大于 :value.',
|
'numeric' => ':attribute必须大于 :value.',
|
||||||
|
|
|
@ -32,6 +32,7 @@ return [
|
||||||
'digits_between' => ':attribute 必須為 :min 到 :max 位數。',
|
'digits_between' => ':attribute 必須為 :min 到 :max 位數。',
|
||||||
'email' => ':attribute 必須是有效的電子郵件地址。',
|
'email' => ':attribute 必須是有效的電子郵件地址。',
|
||||||
'ends_with' => ':attribute必須以下列之一結尾::values',
|
'ends_with' => ':attribute必須以下列之一結尾::values',
|
||||||
|
'file' => 'The :attribute must be provided as a valid file.',
|
||||||
'filled' => ':attribute 欄位必填。',
|
'filled' => ':attribute 欄位必填。',
|
||||||
'gt' => [
|
'gt' => [
|
||||||
'numeric' => ':attribute 必須大於 :value。',
|
'numeric' => ':attribute 必須大於 :value。',
|
||||||
|
|
|
@ -102,6 +102,30 @@ class AttachmentsApiTest extends TestCase
|
||||||
unlink(storage_path($newItem->path));
|
unlink(storage_path($newItem->path));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function test_upload_limit_restricts_attachment_uploads()
|
||||||
|
{
|
||||||
|
$this->actingAsApiAdmin();
|
||||||
|
/** @var Page $page */
|
||||||
|
$page = Page::query()->first();
|
||||||
|
|
||||||
|
config()->set('app.upload_limit', 1);
|
||||||
|
|
||||||
|
$file = tmpfile();
|
||||||
|
$filePath = stream_get_meta_data($file)['uri'];
|
||||||
|
fwrite($file, str_repeat('a', 1200000));
|
||||||
|
$file = new UploadedFile($filePath, 'test.txt', 'text/plain', null, true);
|
||||||
|
|
||||||
|
$details = [
|
||||||
|
'name' => 'My attachment',
|
||||||
|
'uploaded_to' => $page->id,
|
||||||
|
];
|
||||||
|
$resp = $this->call('POST', $this->baseEndpoint, $details, [], ['file' => $file]);
|
||||||
|
$resp->assertStatus(422);
|
||||||
|
$resp->assertJson($this->validationResponse([
|
||||||
|
'file' => ['The file may not be greater than 1000 kilobytes.'],
|
||||||
|
]));
|
||||||
|
}
|
||||||
|
|
||||||
public function test_name_needed_to_create()
|
public function test_name_needed_to_create()
|
||||||
{
|
{
|
||||||
$this->actingAsApiAdmin();
|
$this->actingAsApiAdmin();
|
||||||
|
@ -115,15 +139,7 @@ class AttachmentsApiTest extends TestCase
|
||||||
|
|
||||||
$resp = $this->postJson($this->baseEndpoint, $details);
|
$resp = $this->postJson($this->baseEndpoint, $details);
|
||||||
$resp->assertStatus(422);
|
$resp->assertStatus(422);
|
||||||
$resp->assertJson([
|
$resp->assertJson($this->validationResponse(['name' => ['The name field is required.']]));
|
||||||
'error' => [
|
|
||||||
'message' => 'The given data was invalid.',
|
|
||||||
'validation' => [
|
|
||||||
'name' => ['The name field is required.'],
|
|
||||||
],
|
|
||||||
'code' => 422,
|
|
||||||
],
|
|
||||||
]);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function test_link_or_file_needed_to_create()
|
public function test_link_or_file_needed_to_create()
|
||||||
|
@ -139,16 +155,27 @@ class AttachmentsApiTest extends TestCase
|
||||||
|
|
||||||
$resp = $this->postJson($this->baseEndpoint, $details);
|
$resp = $this->postJson($this->baseEndpoint, $details);
|
||||||
$resp->assertStatus(422);
|
$resp->assertStatus(422);
|
||||||
$resp->assertJson([
|
$resp->assertJson($this->validationResponse([
|
||||||
'error' => [
|
|
||||||
'message' => 'The given data was invalid.',
|
|
||||||
'validation' => [
|
|
||||||
'file' => ['The file field is required when link is not present.'],
|
'file' => ['The file field is required when link is not present.'],
|
||||||
'link' => ['The link field is required when file is not present.'],
|
'link' => ['The link field is required when file is not present.'],
|
||||||
],
|
]));
|
||||||
'code' => 422,
|
}
|
||||||
],
|
|
||||||
]);
|
public function test_message_shown_if_file_is_not_a_valid_file()
|
||||||
|
{
|
||||||
|
$this->actingAsApiAdmin();
|
||||||
|
/** @var Page $page */
|
||||||
|
$page = Page::query()->first();
|
||||||
|
|
||||||
|
$details = [
|
||||||
|
'name' => 'my attachment',
|
||||||
|
'uploaded_to' => $page->id,
|
||||||
|
'file' => 'cat',
|
||||||
|
];
|
||||||
|
|
||||||
|
$resp = $this->postJson($this->baseEndpoint, $details);
|
||||||
|
$resp->assertStatus(422);
|
||||||
|
$resp->assertJson($this->validationResponse(['file' => ['The file must be provided as a valid file.']]));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function test_read_endpoint_for_link_attachment()
|
public function test_read_endpoint_for_link_attachment()
|
||||||
|
|
|
@ -657,6 +657,39 @@ class PageContentTest extends TestCase
|
||||||
$this->deleteImage($imagePath);
|
$this->deleteImage($imagePath);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function test_markdown_base64_extract_not_limited_by_pcre_limits()
|
||||||
|
{
|
||||||
|
$pcreBacktrackLimit = ini_get('pcre.backtrack_limit');
|
||||||
|
$pcreRecursionLimit = ini_get('pcre.recursion_limit');
|
||||||
|
|
||||||
|
$this->asEditor();
|
||||||
|
$page = Page::query()->first();
|
||||||
|
|
||||||
|
ini_set('pcre.backtrack_limit', '500');
|
||||||
|
ini_set('pcre.recursion_limit', '500');
|
||||||
|
|
||||||
|
$content = str_repeat('a', 5000);
|
||||||
|
$base64Content = base64_encode($content);
|
||||||
|
|
||||||
|
$this->put($page->getUrl(), [
|
||||||
|
'name' => $page->name, 'summary' => '',
|
||||||
|
'markdown' => 'test  ',
|
||||||
|
]);
|
||||||
|
|
||||||
|
$page->refresh();
|
||||||
|
$this->assertStringMatchesFormat('<p%A>test <img src="http://localhost/uploads/images/gallery/%A.jpeg" alt="test"> <img src="http://localhost/uploads/images/gallery/%A.jpeg" alt="test">%A</p>%A', $page->html);
|
||||||
|
|
||||||
|
$matches = [];
|
||||||
|
preg_match('/src="http:\/\/localhost(.*?)"/', $page->html, $matches);
|
||||||
|
$imagePath = $matches[1];
|
||||||
|
$imageFile = public_path($imagePath);
|
||||||
|
$this->assertEquals($content, file_get_contents($imageFile));
|
||||||
|
|
||||||
|
$this->deleteImage($imagePath);
|
||||||
|
ini_set('pcre.backtrack_limit', $pcreBacktrackLimit);
|
||||||
|
ini_set('pcre.recursion_limit', $pcreRecursionLimit);
|
||||||
|
}
|
||||||
|
|
||||||
public function test_base64_images_within_markdown_blanked_if_not_supported_extension_for_extract()
|
public function test_base64_images_within_markdown_blanked_if_not_supported_extension_for_extract()
|
||||||
{
|
{
|
||||||
$this->asEditor();
|
$this->asEditor();
|
||||||
|
|
Loading…
Reference in New Issue