Make WordPress Core

Opened 13 months ago

Last modified 13 months ago

#44963 new defect (bug)

PHP Notice: Undefined variable in wp-includes/rest-api.php $args['type']

Reported by: weblogma Owned by:
Milestone: Awaiting Review Priority: normal
Severity: minor Version:
Component: REST API Keywords: has-patch reporter-feedback
Focuses: rest-api Cc:
PR Number:

Description (last modified by SergeyBiryukov)

This problem occur in rest_validate_value_from_schema and rest_sanitize_value_from_schema functions.
Please add

if ( isset($args['type']) && 'array' === $args['type'] )...

isset($args['type']) before *** === $args['type'] for fixed these.

Attachments (2)

rest-api.php (39.2 KB) - added by weblogma 13 months ago.
I fixed bugs in this file.
44963.patch (789 bytes) - added by mukesh27 13 months ago.
You have to add patch like attached.

Download all attachments as: .zip

Change History (6)

13 months ago

I fixed bugs in this file.

#1 @mukesh27
13 months ago

  • Keywords needs-patch added

Hi @weblogma, welcome to WordPress Meta Trac!

Last edited 13 months ago by mukesh27 (previous) (diff)

13 months ago

You have to add patch like attached.

#2 @mukesh27
13 months ago

  • Keywords has-patch added; needs-patch removed
  • Severity changed from normal to minor

#3 @TimothyBlynJacobs
13 months ago

@weblogma Can you attach what schema you are using? Or are you using the function directly?

#4 @SergeyBiryukov
13 months ago

  • Description modified (diff)
  • Keywords reporter-feedback added; dev-feedback removed
Note: See TracTickets for help on using tickets.