dolibarr-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Dolibarr-dev] Question about isValidUrl function


From: Marcos García
Subject: Re: [Dolibarr-dev] Question about isValidUrl function
Date: Fri, 31 Oct 2014 10:46:31 +0100

Hi all:

Well, I did some checks with filter_var function and they would not have the same behaviour:

1. There's a bug in PHP that wasn't solved until PHP 5.3.2 that does not allow dashes in the URL
2. The scheme validation (optional in the actual behaviour) is not optional in FILTER_VALIDATE_URL

So I preferred to not touch it.

Regards,
 
Marcos García
address@hidden

2014-07-20 13:23 GMT+02:00 Destailleur Laurent <address@hidden>:
So ok to keep dolibarr functions but using the native php code inside instead  (for compatibility reason + it help when native function need t obe extended)


2014-07-18 10:17 GMT+02:00 [Kreiz IT]Cédric GROSS <address@hidden>:

Hello,

 

I agree. Just do a wrapper. And may be review also GETPOST to use also filter_var or more precisely filter_input ;)

 

Cedric

 

De : dolibarr-dev-bounces+c.gross=address@hidden [mailto:dolibarr-dev-bounces+c.gross=address@hidden] De la part de Florian Henry
Envoyé : vendredi 18 juillet 2014 10:09
À : Posts about Dolibarr ERP & CRM development and coding
Objet : Re: [Dolibarr-dev] Question about isValidUrl function

 

I think that native PHP fonction is now OK to ne use everywhere.



Envoyer depuis mon mobile.


"Doursenaud, Raphaël" <address@hidden> a écrit :

Hi Marcos,

 

I wouldn't delete parameters because there may be some external modules that rely on this function.

But I think we could benefit from using it as a wrapper to php native functions and maybe deprecate it so module developers know they should use the native functions directly.

 

What do you think?

 

2014-07-17 21:23 GMT+02:00 Marcos García <address@hidden>:

Hi all:

 

I've been looking at isValidUrl function (located in core/lib/functions2.lib.php) and it has multiple parameters that are not used all over Dolibarr code.

 

 

Also, there's already a function in the core of PHP that does the same. Can we replace all the preg checks (that have high CPU cost) with the filter_var function or is there any reason why those checks are there?

 

 

Regards,

 

Marcos García

address@hidden


_______________________________________________
Dolibarr-dev mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/dolibarr-dev



 

--

 

Image supprimée par l'expéditeur.

http://gpcsolutions.fr

Technopole Hélioparc

2 avenue du Président Pierre Angot

64053 PAU CEDEX 9

SARL GPC.solutions au capital de 7 500 € - R.C.S. PAU 528 995 921

Image supprimée par l'expéditeur.Image supprimée par l'expéditeur.


_______________________________________________
Dolibarr-dev mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/dolibarr-dev




--
Laurent Destailleur (alias Eldy)
------------------------------------------------------------------------------------
Social networks of my OpenSource projects:


_______________________________________________
Dolibarr-dev mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/dolibarr-dev



reply via email to

[Prev in Thread] Current Thread [Next in Thread]