Make WordPress Core

Opened 6 years ago

Closed 4 months ago

#38379 closed feature request (maybelater)

Add server side validation class in wordpress core

Reported by: lpkapil008's profile lpkapil008 Owned by:
Milestone: Priority: normal
Severity: normal Version: 4.7
Component: External Libraries Keywords: 2nd-opinion
Focuses: Cc:


Server side validations are most effective way of filtering the input. WordPress does not have any inbuilt validation library or class for server side validations.There are many several libraries available that can be used for this.

I would suggest using opensource library or better we can class for validations.
Valitron, It is tried and tested in many projects, And simply it works like charm.

Change History (4)

#1 @swissspidy
6 years ago

Hey there,

Thanks for opening this ticket. Valitron is not compatible with PHP 5.2 as it uses namespaces. Thus, we can't use it in core.

Can you perhaps elaborate on why such a library is needed and the built-in sanitizing and escaping functions do not suffice?

#2 @lpkapil008
6 years ago

Hi swissspidy,

I understand your opinion. But yes in terms of validation escaping functions are not sufficient. In complex projects we need to validation different kind of ranges and types and need to check limits, for that having a standard library/class is a really good option instead of using functions or writing custom functions for checking ranges and limits etc.

About validation library valitron, We can remove the namespace to make it compatible with PHP5.2. Validation Class always work either with namespace or without namespace.

Also having an inbuilt validation class will be an extra feature in CMS, instead of looking for functions and creating custom functions for complex validations.

#3 @desrosj
4 years ago

  • Keywords 2nd-opinion added

#4 @desrosj
4 months ago

  • Milestone Awaiting Review deleted
  • Resolution set to maybelater
  • Status changed from new to closed

I'm going to close this one out. I don't personally see how this can benefit the majority of users, and there doesn't seem to be overwhelming demand as no other contributors have weighed in for 6+ years.

Discussion can always continue on closed tickets, and should factors change in the future, this can be reopened.

Note: See TracTickets for help on using tickets.