mirror of
https://github.com/Chouchen/ShikiryuRSS.git
synced 2025-09-05 13:04:32 +02:00
@@ -2,9 +2,11 @@
|
||||
|
||||
namespace Shikiryu\SRSS;
|
||||
|
||||
use DateTimeInterface;
|
||||
|
||||
class SRSSTools
|
||||
{
|
||||
public static function check($check, $flag)
|
||||
/*public static function check($check, $flag)
|
||||
{
|
||||
return match ($flag) {
|
||||
'nohtml' => self::noHTML($check),
|
||||
@@ -19,11 +21,9 @@ class SRSSTools
|
||||
'media_type' => self::checkMediaType($check),
|
||||
'media_medium' => self::checkMediaMedium($check),
|
||||
'bool' => self::checkBool($check),
|
||||
'medium_expression' => self::checkMediumExpression($check),
|
||||
'' => $check,
|
||||
default => throw new SRSSException('flag ' . $flag . ' does not exist.'),
|
||||
'medium_expression' => self::checkMediumExpression($check)
|
||||
};
|
||||
}
|
||||
}*/
|
||||
|
||||
/**
|
||||
* format the RSS to the wanted format
|
||||
@@ -61,6 +61,10 @@ class SRSSTools
|
||||
return date("D, d M Y H:i:s T", strtotime($date));
|
||||
}
|
||||
|
||||
if (count(explode(' ', $date)) === 2) {
|
||||
return \DateTime::createFromFormat('Y-m-d H:i:s', $date)->format(DateTimeInterface::RSS);
|
||||
}
|
||||
|
||||
[$j, $m, $a] = explode('/', $date);
|
||||
|
||||
return date("D, d M Y H:i:s T", strtotime($a.'-'.$m.'-'.$j));
|
||||
|
Reference in New Issue
Block a user