update 2023-06-22 06:54:52
This commit is contained in:
parent
552101bc1a
commit
305738aaf7
@ -178,16 +178,16 @@ final class DailyScripture
|
||||
private function extract(string $reference): ?string
|
||||
{
|
||||
// Use regex to match everything before the chapter:verse part
|
||||
preg_match('/^(.*?)\s\d+:\d+/', $reference, $matches);
|
||||
$bookName = trim($matches[1]) ?? '';
|
||||
preg_match('/^(.*)\s(\d+:\d+|\d+)?$/', $reference, $matches);
|
||||
$bookName = $matches[1] ?? '';
|
||||
|
||||
// Check if the book name is a number
|
||||
if (is_numeric($bookName) || $bookName === '')
|
||||
if (is_numeric($bookName) || trim($bookName) === '')
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
return $bookName;
|
||||
return trim($bookName);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -152,16 +152,16 @@
|
||||
private function extract(string $reference): ?string
|
||||
{
|
||||
// Use regex to match everything before the chapter:verse part
|
||||
preg_match('/^(.*?)\s\d+:\d+/', $reference, $matches);
|
||||
$bookName = trim($matches[1]) ?? '';
|
||||
preg_match('/^(.*)\s(\d+:\d+|\d+)?$/', $reference, $matches);
|
||||
$bookName = $matches[1] ?? '';
|
||||
|
||||
// Check if the book name is a number
|
||||
if (is_numeric($bookName) || $bookName === '')
|
||||
if (is_numeric($bookName) || trim($bookName) === '')
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
return $bookName;
|
||||
return trim($bookName);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user