Merge pull request #229 from Tofandel/patch-1

Fix PHP notice "Undefined offset: 1 in readme-parser.php on line 124".
This commit is contained in:
Yahnis Elsts 2018-09-26 11:00:31 +03:00 committed by GitHub
commit e2da891646
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -121,7 +121,7 @@ class PucReadmeParser {
$_sections = preg_split('/^[\s]*==[\s]*(.+?)[\s]*==/m', $file_contents, -1, PREG_SPLIT_DELIM_CAPTURE|PREG_SPLIT_NO_EMPTY);
$sections = array();
for ( $i=1; $i <= count($_sections); $i +=2 ) {
for ( $i=1; $i < count($_sections); $i +=2 ) {
$_sections[$i] = preg_replace('/(^[\s]*)=[\s]+(.+?)[\s]+=/m', '$1<h4>$2</h4>', $_sections[$i]);
$_sections[$i] = $this->filter_text( $_sections[$i], true );
$title = $this->sanitize_text( $_sections[$i-1] );
@ -334,4 +334,4 @@ class PucReadmeParser {
} // end class
endif;
endif;