Skip to content

Commit

Permalink
Fixed passing null to integer param
Browse files Browse the repository at this point in the history
  • Loading branch information
GrahamCampbell committed Sep 6, 2021
1 parent ed15dba commit e73e439
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Gitonomy/Git/Parser/ParserBase.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ protected function expects($expected)

protected function consumeShortHash()
{
if (!preg_match('/([A-Za-z0-9]{7,40})/A', $this->content, $vars, null, $this->cursor)) {
if (!preg_match('/([A-Za-z0-9]{7,40})/A', $this->content, $vars, 0, $this->cursor)) {
throw new RuntimeException('No short hash found: '.substr($this->content, $this->cursor, 7));
}

Expand All @@ -70,7 +70,7 @@ protected function consumeShortHash()

protected function consumeHash()
{
if (!preg_match('/([A-Za-z0-9]{40})/A', $this->content, $vars, null, $this->cursor)) {
if (!preg_match('/([A-Za-z0-9]{40})/A', $this->content, $vars, 0, $this->cursor)) {
throw new RuntimeException('No hash found: '.substr($this->content, $this->cursor, 40));
}

Expand All @@ -81,7 +81,7 @@ protected function consumeHash()

protected function consumeRegexp($regexp)
{
if (!preg_match($regexp.'A', $this->content, $vars, null, $this->cursor)) {
if (!preg_match($regexp.'A', $this->content, $vars, 0, $this->cursor)) {
throw new RuntimeException('No match for regexp '.$regexp.' Upcoming: '.substr($this->content, $this->cursor, 30));
}

Expand Down

0 comments on commit e73e439

Please sign in to comment.