WP_REST_Plugins_Controller::validate_plugin_param( string $file )

Checks that the “plugin” parameter is a valid path.


Parameters Parameters

$file

(string) (Required) The plugin file parameter.


Top ↑

Return Return

(bool)


Top ↑

Source Source

File: wp-includes/rest-api/endpoints/class-wp-rest-plugins-controller.php

	public function validate_plugin_param( $file ) {
		if ( ! is_string( $file ) || ! preg_match( '/' . self::PATTERN . '/u', $file ) ) {
			return false;
		}

		$validated = validate_file( plugin_basename( $file ) );

		return 0 === $validated;
	}


Top ↑

Changelog Changelog

Changelog
Version Description
5.5.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.