diff --git a/SourceGitweb/SourceGitweb.php b/SourceGitweb/SourceGitweb.php index ea74280..d1187f6 100644 --- a/SourceGitweb/SourceGitweb.php +++ b/SourceGitweb/SourceGitweb.php @@ -272,8 +272,7 @@ if ( !SourceChangeset::exists( $p_repo->id, $t_commit['revision'] ) ) { # Parse for commit data - preg_match( '#author(?:]*>)?([^<>]*)(?:)? *(?:]*>)?<([^<>]*)>(?:)?(?:<[^<>]*>\s*)*?'. - ' \w*, (\d* \w* \d* \d*:\d*:\d*)#', $t_gitweb_data, $t_matches ); + preg_match( '#author(?:]*>)?([^<>]*)(?:)? *(?:]*>)?<([^<>]*)>(?:)?(?:<[^<>]*>\s*)*?\n\w*, (\d* \w* \d* \d*:\d*:\d*)#', $t_gitweb_data, $t_matches ); $t_commit['author'] = $t_matches[1]; $t_commit['author_email'] = $t_matches[2]; $t_commit['date'] = date( 'Y-m-d H:i:s', strtotime( $t_matches[3] ) ); @@ -290,7 +289,7 @@ } } - preg_match( '#
(.*)
#', $t_gitweb_data, $t_matches ); + preg_match( '#
\n(.*)\n
#', $t_gitweb_data, $t_matches ); $t_commit['message'] = trim( str_replace( '
', PHP_EOL, $t_matches[1] ) ); # Strip ref links and signoff spans from commit message @@ -302,8 +301,8 @@ # Parse for changed file data $t_commit['files'] = array(); - preg_match_all( '#([^<>]+)'. - '(?:[^<>]*)?#', + preg_match_all( '#\n([^<>]+)'. + '\n(?:[^<>]*)?#', $t_gitweb_files, $t_matches, PREG_SET_ORDER ); foreach( $t_matches as $t_file_matches ) {