Skip to content

Commit

Permalink
Fix Syntax error in SourceHgWeb.php with PHP 5.5
Browse files Browse the repository at this point in the history
Fixes #265
  • Loading branch information
dregad committed Apr 9, 2018
1 parent 53042f9 commit 6d51f69
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions SourceHgWeb/SourceHgWeb.php
Original file line number Diff line number Diff line change
Expand Up @@ -263,11 +263,14 @@ private function commit_changeset( $p_repo, $p_input, $p_branch='' ) {
# Process changeset metadata
$t_commit = array();
$t_parents = array();
static $s_pattern_metadata = '/^# (?:'
. self::PATTERN_USER . '|'
. self::PATTERN_DATE . '|'
. self::PATTERN_REVISION
. ')/J';
static $s_pattern_metadata;
if( !$s_pattern_metadata ) {
$s_pattern_metadata = '/^# (?:'
. self::PATTERN_USER . '|'
. self::PATTERN_DATE . '|'
. self::PATTERN_REVISION
. ')/J';
}
while( true ) {
$t_match = preg_match( $s_pattern_metadata, $t_input[$i], $t_metadata );
if( $t_match == false ) {
Expand Down Expand Up @@ -316,11 +319,14 @@ private function commit_changeset( $p_repo, $p_input, $p_branch='' ) {

$t_changeset->author_email = empty($t_commit['author_email'])? '': $t_commit['author_email'];

static $s_pattern_diff = '#'
static $s_pattern_diff;
if( !$s_pattern_diff ) {
$s_pattern_diff = '#'
. self::PATTERN_DIFF . '\n('
. self::PATTERN_BINARY_FILE . '|'
. self::PATTERN_PLUS_MINUS
. ')#u';
}
preg_match_all( $s_pattern_diff, $p_input, $t_matches, PREG_SET_ORDER );

$t_commit['files'] = array();
Expand Down

0 comments on commit 6d51f69

Please sign in to comment.