diff --git a/SourceGitweb/SourceGitweb.php b/SourceGitweb/SourceGitweb.php index 51657d8..c9fa3c7 100644 --- a/SourceGitweb/SourceGitweb.php +++ b/SourceGitweb/SourceGitweb.php @@ -231,19 +231,23 @@ $t_input = str_replace( array(PHP_EOL, '<', '>'), array('', '<', '>'), $p_input ); # Exract sections of commit data and changed files - if ( ! $t_result = preg_match( '#
(.*)
#', $t_input, $t_matches ) ) { - echo 'commit data failed!'; - return array(); + $t_input_p1 = strpos( $t_input, '
' ); + $t_input_p2 = strpos( $t_input, '
' ); + if ( false === $t_input_p1 || false === $t_input_p2 ) { + echo 'commit data failure.'; + var_dump( strlen( $t_input ), $t_input_p1, $t_input_p2 ); + die(); } + $t_gitweb_data = substr( $t_input, $t_input_p1, $t_input_p2 - $t_input_p1 ); - $t_gitweb_data = $t_matches[1]; - - if ( ! $t_result = preg_match( '#(.*)