bestmomo / laravel5-5-example

Laravel 5.5 example for tutorial
217 stars 122 forks source link

Tags and keywords are not valid in Russian. #24

Closed yuri25 closed 6 years ago

yuri25 commented 6 years ago

https://github.com/EamonKeane/laravel5-5-example/blob/master/app/Http/Requests/PostRequest.php $regex = '/^[A-Za-z0-9-éèàù]{1,50}?(,[A-Za-z0-9-éèàù]{1,50})*$/';

Is the problem in this expression or does something need to be fixed yet? Help me please.

bestmomo commented 6 years ago

Hi, I think it's is this regex, you should add russian specific characters.

yuri25 commented 6 years ago

I did this: $regex = '/^[A-Za-z0-9-А-Яа-я0-9]{1,50}?(,[A-Za-z0-9-А-Яа-я0-9]{1,50})*$/';

All the same does not pass validation .... What do you need more or what actions to take? And what do these symbols in general mean - éèàù

yuri25 commented 6 years ago

Also does not help this kind of: $regex = '/^[A-Za-z0-9А-Яа-я]{1,50}?(,[A-Za-z0-9А-Яа-я]{1,50})*$/';

bestmomo commented 6 years ago

Look at this question for Regex Russian Cyrillic class management.

yuri25 commented 6 years ago

I brought to this form: $regex = '/^[\p{L}zA-Z0-9]{1,50}?(,[\p{L}zA-Z0-9]{1,50})*$/'; Probably you need to change files somewhere else ... But where? tagskey

bestmomo commented 6 years ago

This regex is the only place for tag validation, you can check this if you remove regex rule. So your class must be wrong.

yuri25 commented 6 years ago

The problem with tags is solved, the expression works fine. $regex = '/^[\p{L}zA-Z0-9]{1,50}?(,[\p{L}zA-Z0-9]{1,50})*$/u'; - Working. When posting a post, the problem of the image remained unresolved ...

Intervention \ Image \ Exception \ NotReadableException Unable to init from given url (http://youwo.ru/\files/yandex_2.jpg). Rights to the folder changed several times and the owners also changed - nothing helps: ( Why is such a strange URL (http://youwo.ru/\files/yandex_2.jpg) ..../vendor/intervention/image/src/Intervention/Image/AbstractDecoder.php

   83     throw new \Intervention\Image\Exception\NotReadableException(
   84        "Unable to init from given url (".$url.")."
yuri25 commented 6 years ago

It seems to me that the path to the image is being formed incorrectly and because of this an error appears ... Whence the backslash? screenshot 4

yuri25 commented 6 years ago

If I manually change the backslash on a line, then this error is missing and the publication is successful. Look, please, where to fix, so that the backslash does not appear. Every time manually correcting it on a straight line is not good ... screenshot 5

yuri25 commented 6 years ago

What do you think about this error? Unable to init from given url (http://youwo.ru/\files/yandex_2.jpg).

yuri25 commented 6 years ago

Error found here: /...../resources/views/back/posts/template.blade.php

222        function processSelectedFile(filePath, requestingField) {
223            $('#' + requestingField).val('\\' + filePath)
224            $('#img').attr('src', '\\' + filePath)
225           }

It is necessary to change slashes as follows:

222        function processSelectedFile(filePath, requestingField) {
223            $('#' + requestingField).val('\/' + filePath)
224            $('#img').attr('src', '\/' + filePath)
225           }

Now this error has been fixed.