Fix PHP notice "Undefined offset: 1 in readme-parser.php on line 124".
The for loop was iterating including the count index of the $_sections, it should be excluding
This commit is contained in:
parent
c9a7d2a7da
commit
89e8849957
|
|
@ -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 = preg_split('/^[\s]*==[\s]*(.+?)[\s]*==/m', $file_contents, -1, PREG_SPLIT_DELIM_CAPTURE|PREG_SPLIT_NO_EMPTY);
|
||||||
|
|
||||||
$sections = array();
|
$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] = preg_replace('/(^[\s]*)=[\s]+(.+?)[\s]+=/m', '$1<h4>$2</h4>', $_sections[$i]);
|
||||||
$_sections[$i] = $this->filter_text( $_sections[$i], true );
|
$_sections[$i] = $this->filter_text( $_sections[$i], true );
|
||||||
$title = $this->sanitize_text( $_sections[$i-1] );
|
$title = $this->sanitize_text( $_sections[$i-1] );
|
||||||
|
|
@ -334,4 +334,4 @@ class PucReadmeParser {
|
||||||
|
|
||||||
} // end class
|
} // end class
|
||||||
|
|
||||||
endif;
|
endif;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue