Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

laravel validation

10 views
Skip to first unread message

Jan Novak

unread,
Dec 29, 2016, 11:55:28 AM12/29/16
to
Hi,

i search for a laraval validation rule for directory pathes.
I want to know if the path exists and is writable, what was entered in a
form and will evaluated in the contoller.

At the moment i have only

$this->validate($request,
['path'=>'required|unique:archive,path,'.$request->id,'id']);

for validation (path is required and must be unique)
But how to include the rule for is_directory and is_writable ?

Jan

Jerry Stuckle

unread,
Dec 29, 2016, 1:19:25 PM12/29/16
to
Jan,

I don't use laravel (I'm not sure if anyone here does). But what
exactly is it you are trying to do?

It looks like possibly you are allowing someone to upload a file to a
directory they specify on your site. If so, be aware this is extremely
dangerous. They could easily upload malicious code, such as a script
that downloads a virus or code that dumps your entire website (including
passwords, etc.) to them.

If this isn't the case, can you please explain what you're trying to
accomplish? Perhaps there is an easier way to do what you want.

I also see they have a pretty active forum at www.laracasts.com/discuss.
You might try asking there.

--
==================
Remove the "x" from my email address
Jerry Stuckle
jstu...@attglobal.net
==================

Jan Novak

unread,
Dec 30, 2016, 2:59:01 AM12/30/16
to
Am 29.12.2016 um 19:19 schrieb Jerry Stuckle:

>> i search for a laraval validation rule for directory pathes.
>> I want to know if the path exists and is writable, what was entered in a
>> form and will evaluated in the contoller.
>>
>> At the moment i have only
>>
>> $this->validate($request,
>> ['path'=>'required|unique:archive,path,'.$request->id,'id']);
>>
>> for validation (path is required and must be unique)
>> But how to include the rule for is_directory and is_writable ?
>>
> directory they specify on your site. If so, be aware this is extremely
> dangerous.

I know, but it is an intranet application (DMS).

> If this isn't the case, can you please explain what you're trying to
> accomplish? Perhaps there is an easier way to do what you want.

It is an laravel question, because of this spcial "validators" inside
laravel.
I have already try the laravel forum, but until now, i havent got an
answer. Maybe i try it again.

thx.

Jan

Jerry Stuckle

unread,
Dec 30, 2016, 8:56:20 AM12/30/16
to
On 12/30/2016 2:58 AM, Jan Novak wrote:
> Am 29.12.2016 um 19:19 schrieb Jerry Stuckle:
>
>>> i search for a laraval validation rule for directory pathes.
>>> I want to know if the path exists and is writable, what was entered in a
>>> form and will evaluated in the contoller.
>>>
>>> At the moment i have only
>>>
>>> $this->validate($request,
>>> ['path'=>'required|unique:archive,path,'.$request->id,'id']);
>>>
>>> for validation (path is required and must be unique)
>>> But how to include the rule for is_directory and is_writable ?
>>>
>> directory they specify on your site. If so, be aware this is extremely
>> dangerous.
>
> I know, but it is an intranet application (DMS).
>

Even more dangerous. More successful hacks occur from internal sources
than external. People thing that just because something is intranet it
is safe. That is far from reality.

>> If this isn't the case, can you please explain what you're trying to
>> accomplish? Perhaps there is an easier way to do what you want.
>
> It is an laravel question, because of this spcial "validators" inside
> laravel.
> I have already try the laravel forum, but until now, i havent got an
> answer. Maybe i try it again.
>
> thx.
>
> Jan
>

Right, but that's why I was asking what you are trying to do. Perhaps
we can find a different way of doing it.

Jan Novak

unread,
Dec 30, 2016, 10:03:32 AM12/30/16
to
Am 30.12.2016 um 14:56 schrieb Jerry Stuckle:
>>> directory they specify on your site. If so, be aware this is extremely
>>> dangerous.
>>
>> I know, but it is an intranet application (DMS).
>>
>
> Even more dangerous.


Thats true ... but this is not the question at this moment. I need the
upload, because its an DMS :-) Everything else is or will be done with
max security - one thing ist the check of the upload itself and the
existing directory.

>> I have already try the laravel forum, but until now, i havent got an
>> answer. Maybe i try it again.

Laravel is in my eyes very smart and if you use it right, then you have
a very good basic security (php) app.

> Right, but that's why I was asking what you are trying to do. Perhaps
> we can find a different way of doing it.

One part of laravel is the internal validation - i havent found a way to
validate the not only the input, but also the directory structure...

Jan

Christoph M. Becker

unread,
Dec 30, 2016, 10:16:08 AM12/30/16
to
I have no experience with Laravel, but maybe the following helps:
<https://laracasts.com/discuss/channels/general-discussion/l5-where-to-add-custom-validation-function>.

--
Christoph M. Becker

Härra Ramob

unread,
Jan 2, 2022, 6:49:43 AM1/2/22
to
ʕʘ̅͜ʘ̅ʔ

ʕʘ̅͜ʘ̅ʔ

ʕʘ̅͜ʘ̅ʔ

ʕʘ̅͜ʘ̅ʔ

ʕʘ̅͜ʘ̅ʔ

ʕʘ̅͜ʘ̅ʔ

ʕʘ̅͜ʘ̅ʔ

ʕʘ̅͜ʘ̅ʔ

ʕʘ̅͜ʘ̅ʔ

ʕʘ̅͜ʘ̅ʔ

ʕʘ̅͜ʘ̅ʔ

ʕʘ̅͜ʘ̅ʔ

ʕʘ̅͜ʘ̅ʔ

ʕʘ̅͜ʘ̅ʔ
0 new messages