1
0
mirror of https://github.com/RSS-Bridge/rss-bridge.git synced 2025-01-16 13:50:01 +01:00

Fix: Ensure $time is set from innertext when datetime attribute is not found (#4111)

This commit addresses a bug where the $time variable is not set from the innertext of the $time_element when the datetime attribute is not found. The previous implementation only checked if $time was null or an empty string, which did not cover all cases where the datetime attribute might be missing. By using the empty() function, we ensure that $time is correctly set from the innertext when the datetime attribute is not present.
This commit is contained in:
Albert Kiskorov 2024-05-19 19:37:59 +07:00 committed by GitHub
parent 75f35391fa
commit dc199ebf5c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -442,7 +442,7 @@ class CssSelectorComplexBridge extends BridgeAbstract
if (!is_null($time_selector) && $time_selector != '') {
$time_element = $entry_html->find($time_selector, 0);
$time = $time_element->getAttribute('datetime');
if (is_null($time)) {
if (empty($time)) {
$time = $time_element->innertext;
}