You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
In case there is an empty line between headers in the readme.txt file, the parser parses correctly only headers before the empty line: other headers are incorrectly parsed as short description and the short description is not parsed at all.
To Reproduce
Edit the readme.txt file of a theme by adding an empty line between headers. An easy way to catch the bug is to add the empty line before the License header.
Run the Theme Sniffer: you'll get the two following warnings (since the parser cannot parse the License header, the license property is empty).
No matching license critera could be determined from: !
Unable to determine License URI with an invalid License supplied in readme.txt!
Remove the empty line between headers in the readme.txt file.
Run the Theme Sniffer again: the warnings disappear.
Expected behavior
I'm not aware of guidelines preventing developers from adding line breaks between headers.
As such, I would expect that adding one or more empty lines between headers doesn't cause parsing errors.
Environment
OS: Windows
Browser: both Chrome and Firefox
Version: both 1.1.2 and development
PHP Version: 7.4
WP Version: development
Additional context
The following snippet shows that the parser has a few lines of code intended to allow line breaks between headers.
// Some plugins have line-breaks within the headers.
if ( empty( $line ) ) {
break;
} else {
continue;
}
The cause of this issue is that the break and continue controls are switched: header parsing should continue if the line is empty and it should break if the line is not empty, but it is not a header either (i.e. if it doesn't contain a colon).
Describe the bug
In case there is an empty line between headers in the readme.txt file, the parser parses correctly only headers before the empty line: other headers are incorrectly parsed as short description and the short description is not parsed at all.
To Reproduce
licenseproperty is empty).readme.txtfile.Expected behavior
I'm not aware of guidelines preventing developers from adding line breaks between headers.
As such, I would expect that adding one or more empty lines between headers doesn't cause parsing errors.
Environment
Additional context
The following snippet shows that the parser has a few lines of code intended to allow line breaks between headers.
theme-sniffer/src/sniffs/readme/class-parser.php
Lines 233 to 238 in 1d6c852
The cause of this issue is that the
breakandcontinuecontrols are switched: header parsing should continue if the line is empty and it should break if the line is not empty, but it is not a header either (i.e. if it doesn't contain a colon).