Skip to content

Commit b10b40e

Browse files
committed
ContentExtractor: Fix invalid argument type
This was tripping up selfoss: date_parse(): Passing null to parameter #1 ($datetime) of type string is deprecated [vendor/j0k3r/graby/src/Extractor/ContentExtractor.php:722] [vendor/j0k3r/graby/src/Extractor/ContentExtractor.php:722] date_parse() [vendor/j0k3r/graby/src/Extractor/ContentExtractor.php:541] Graby\Extractor\ContentExtractor->validateDate() [vendor/j0k3r/graby/src/Graby.php:374] Graby\Extractor\ContentExtractor->process() [vendor/j0k3r/graby/src/Graby.php:181] Graby\Graby->doFetchContent() [src/spouts/rss/fulltextrss.php:97] Graby\Graby->fetchContent() [src/spouts/rss/fulltextrss.php:74] spouts\rss\fulltextrss->getFullContent() [src/spouts/Item.php:117] spouts\rss\fulltextrss->spouts\rss\{closure}() [workbench.php:112] spouts\Item->getContent()
1 parent f033c3b commit b10b40e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Extractor/ContentExtractor.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -713,12 +713,13 @@ public function getNextPageUrl()
713713
/**
714714
* Validate and convert a date to the W3C format.
715715
*
716-
* @param string $date
716+
* @param string|null $date
717717
*
718718
* @return string|null Formatted date using the W3C format (Y-m-d\TH:i:sP) OR null if the date is badly formatted
719719
*/
720720
public function validateDate($date)
721721
{
722+
$date = (string) $date;
722723
$parseDate = (array) date_parse($date);
723724

724725
// If no year has been found during date_parse, we nuke the whole value

0 commit comments

Comments
 (0)