From 37843e8777cafd6f7ce16dd233f078d6525bc1f2 Mon Sep 17 00:00:00 2001 From: sysadminstory Date: Sun, 8 May 2022 04:19:06 +0200 Subject: [PATCH] [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 --- bridges/RadioMelodieBridge.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bridges/RadioMelodieBridge.php b/bridges/RadioMelodieBridge.php index 37f32536..6b392394 100644 --- a/bridges/RadioMelodieBridge.php +++ b/bridges/RadioMelodieBridge.php @@ -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);