Skip to content

Commit

Permalink
Update regex for version validation
Browse files Browse the repository at this point in the history
  • Loading branch information
ernilambar committed Nov 27, 2024
1 parent fc3873e commit c21c66d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -186,12 +186,12 @@ public function run( Check_Result $result ) {
7
);
} else {
if ( preg_match( '|[^\d\.]|', $plugin_header['Version'] ) ) {
if ( ! preg_match( '/^[a-z0-9.-]+$/i', $plugin_header['Version'] ) ) {
$this->add_result_error_for_file(
$result,
sprintf(
/* translators: %s: plugin header field */
__( 'The "%s" header in the plugin file should only contain numeric and period characters.', 'plugin-check' ),
__( 'The "%s" header in the plugin should only contain numbers, letters, periods, and hyphens.', 'plugin-check' ),
esc_html( $labels['Version'] )
),
'plugin_header_invalid_plugin_version',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Plugin URI: https://github.com/WordPress/plugin-check
* Requires at least: 6.0
* Requires PHP: 5.6
* Version: 1.0.0-Beta
* Version: 1.0.0 Beta
* Author: WordPress Performance Team
* Author URI: https://github.com/wordpress/plugin-check/
* License: GPLv2 or later
Expand Down

0 comments on commit c21c66d

Please sign in to comment.