[RadioMelodieBridge] Fix date parsing (#2701)

The date is now correctly parsed for every month in the year (There are months mane in french that are 3 letters long
This commit is contained in:
sysadminstory 2022-05-08 04:19:06 +02:00 committed by GitHub
parent 56e991122b
commit 37843e8777
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -56,8 +56,10 @@ class RadioMelodieBridge extends BridgeAbstract {
// Handle date to timestamp
$dateHTML = $article->find('div[class=author]', 0)->children(1)->plaintext;
preg_match('/([a-z]{4,10}[ ]{1,2}[0-9]{1,2} [\p{L}]{4,10} [0-9]{4} à [0-9]{2}:[0-9]{2})/mus', $dateHTML, $matches);
preg_match('/([a-z]{4,10}[ ]{1,2}[0-9]{1,2} [\p{L}]{3,10} [0-9]{4} à [0-9]{2}:[0-9]{2})/mus', $dateHTML, $matches);
$dateText = $matches[1];
$timestamp = $this->parseDate($dateText);
$item['enclosures'] = array_merge($picture, $audio);