feat(legacy): update deprecated PHP code (#2789)

### Description
update deprecated code. It's mergeable with master without syntax
conflicts across php versions
remove deprecated((https://www.php.net/manual/fr/function.strftime.php))
and unsafe (https://cve.mitre.org/cgi-bin/cvekey.cgi?keyword=strftime)
**strftime** syntax

---------

Co-authored-by: mp3butcher <mp3butcher@gmail.com>
Co-authored-by: jo <ljonas@riseup.net>
Co-authored-by: Kyle Robbertze <kyle@paddatrapper.com>
This commit is contained in:
Julien Valentin 2025-03-13 00:19:18 +01:00 committed by GitHub
parent f9c0bd5a05
commit 3a8dcbce60
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
20 changed files with 66 additions and 64 deletions

View File

@ -370,6 +370,7 @@ class FileDataHelper
*/ */
public static function renderImage($file) public static function renderImage($file)
{ {
if ($file && file_exists($file)) {
$im = @imagecreatefromjpeg($file); $im = @imagecreatefromjpeg($file);
$img = $im; $img = $im;
@ -379,6 +380,7 @@ class FileDataHelper
imagedestroy($img); imagedestroy($img);
} }
} }
}
/** /**
* Render Data URI * Render Data URI

View File

@ -1,7 +1,7 @@
<?php <?php
// This file generated by Propel 1.7.3-dev convert-conf target // This file generated by Propel 1.7.3-dev convert-conf target
// from XML runtime conf file /vagrant/legacy/build/runtime-conf.xml // from XML runtime conf file /var/www/html/build/runtime-conf.xml
$conf = [ $conf = [
'datasources' => [ 'datasources' => [
'airtime' => [ 'airtime' => [

View File

@ -284,7 +284,7 @@ class ApiController extends Zend_Controller_Action
// default to the station timezone // default to the station timezone
$timezone = Application_Model_Preference::GetDefaultTimezone(); $timezone = Application_Model_Preference::GetDefaultTimezone();
$userDefinedTimezone = strtolower($request->getParam('timezone')); $userDefinedTimezone = strtolower($request->getParam('timezone') ?? '');
$upcase = false; // only upcase the timezone abbreviations $upcase = false; // only upcase the timezone abbreviations
$this->updateTimezone($userDefinedTimezone, $timezone, $upcase); $this->updateTimezone($userDefinedTimezone, $timezone, $upcase);
@ -410,7 +410,7 @@ class ApiController extends Zend_Controller_Action
// default to the station timezone // default to the station timezone
$timezone = Application_Model_Preference::GetDefaultTimezone(); $timezone = Application_Model_Preference::GetDefaultTimezone();
$userDefinedTimezone = strtolower($request->getParam('timezone')); $userDefinedTimezone = strtolower($request->getParam('timezone') ?? '');
$upcase = false; // only upcase the timezone abbreviations $upcase = false; // only upcase the timezone abbreviations
$this->updateTimezone($userDefinedTimezone, $timezone, $upcase); $this->updateTimezone($userDefinedTimezone, $timezone, $upcase);
@ -1640,7 +1640,7 @@ class ApiController extends Zend_Controller_Action
echo "Recalculated {$total} shows."; echo "Recalculated {$total} shows.";
} }
final private function returnJsonOrJsonp($request, $result) private function returnJsonOrJsonp($request, $result)
{ {
$callback = $request->getParam('callback'); $callback = $request->getParam('callback');
$response = $this->getResponse(); $response = $this->getResponse();
@ -1667,7 +1667,7 @@ class ApiController extends Zend_Controller_Action
* @param mixed $status * @param mixed $status
* @param mixed $message * @param mixed $message
*/ */
final private function jsonError($status, $message) private function jsonError($status, $message)
{ {
$this->getResponse() $this->getResponse()
->setHttpResponseCode($status) ->setHttpResponseCode($status)

View File

@ -50,13 +50,13 @@ class AudiopreviewController extends Zend_Controller_Action
$media = Application_Model_StoredFile::RecallById($audioFileID); $media = Application_Model_StoredFile::RecallById($audioFileID);
$uri = $baseUrl . 'api/get-media/file/' . $audioFileID; $uri = $baseUrl . 'api/get-media/file/' . $audioFileID;
$mime = $media->getPropelOrm()->getDbMime(); $mime = $media->getPropelOrm()->getDbMime();
$this->view->audioFileArtist = htmlspecialchars($media->getPropelOrm()->getDbArtistName()); $this->view->audioFileArtist = htmlspecialchars($media->getPropelOrm()->getDbArtistName() ?? '');
$this->view->audioFileTitle = htmlspecialchars($media->getPropelOrm()->getDbTrackTitle()); $this->view->audioFileTitle = htmlspecialchars($media->getPropelOrm()->getDbTrackTitle() ?? '');
} elseif ($type == 'stream') { } elseif ($type == 'stream') {
$webstream = CcWebstreamQuery::create()->findPk($audioFileID); $webstream = CcWebstreamQuery::create()->findPk($audioFileID);
$uri = $webstream->getDbUrl(); $uri = $webstream->getDbUrl();
$mime = $webstream->getDbMime(); $mime = $webstream->getDbMime();
$this->view->audioFileTitle = htmlspecialchars($webstream->getDbName()); $this->view->audioFileTitle = htmlspecialchars($webstream->getDbName() ?? '');
} else { } else {
throw new Exception("Unknown type for audio preview!.Type={$type}"); throw new Exception("Unknown type for audio preview!.Type={$type}");
} }

View File

@ -63,8 +63,8 @@ class IndexController extends Zend_Controller_Action
$podcastEpisodesService = new Application_Service_PodcastEpisodeService(); $podcastEpisodesService = new Application_Service_PodcastEpisodeService();
$episodes = $podcastEpisodesService->getPodcastEpisodes($stationPodcastId, 0, 0, PodcastEpisodesPeer::PUBLICATION_DATE, 'DESC'); $episodes = $podcastEpisodesService->getPodcastEpisodes($stationPodcastId, 0, 0, PodcastEpisodesPeer::PUBLICATION_DATE, 'DESC');
foreach ($episodes as $e => $v) { foreach ($episodes as $e => $v) {
$episodes[$e]['CcFiles']['track_title'] = htmlspecialchars($v['CcFiles']['track_title'], ENT_QUOTES); $episodes[$e]['CcFiles']['track_title'] = htmlspecialchars($v['CcFiles']['track_title'] ?? '', ENT_QUOTES);
$episodes[$e]['CcFiles']['artist_name'] = htmlspecialchars($v['CcFiles']['artist_name'], ENT_QUOTES); $episodes[$e]['CcFiles']['artist_name'] = htmlspecialchars($v['CcFiles']['artist_name'] ?? '', ENT_QUOTES);
$pubDate = explode(' ', $v['publication_date']); $pubDate = explode(' ', $v['publication_date']);
$episodes[$e]['publication_date'] = $pubDate[0]; $episodes[$e]['publication_date'] = $pubDate[0];

View File

@ -398,7 +398,7 @@ class ScheduleController extends Zend_Controller_Action
$this->view->percentFilled = $show->getPercentScheduled(); $this->view->percentFilled = $show->getPercentScheduled();
$this->view->showContent = $show->getShowListContent(); $this->view->showContent = $show->getShowListContent();
$this->view->dialog = $this->view->render('schedule/show-content-dialog.phtml'); $this->view->dialog = $this->view->render('schedule/show-content-dialog.phtml');
$this->view->showTitle = htmlspecialchars($show->getName()); $this->view->showTitle = htmlspecialchars($show->getName() ?? '');
unset($this->view->showContent); unset($this->view->showContent);
} }

View File

@ -235,8 +235,8 @@ SQL;
$row['orig_length'] = $formatter->format(); $row['orig_length'] = $formatter->format();
// XSS exploit prevention // XSS exploit prevention
$row['track_title'] = htmlspecialchars($row['track_title']); $row['track_title'] = htmlspecialchars($row['track_title'] ?? '');
$row['creator'] = htmlspecialchars($row['creator']); $row['creator'] = htmlspecialchars($row['creator'] ?? '');
} }
return $rows; return $rows;

View File

@ -282,8 +282,8 @@ SQL;
$row['orig_length'] = $formatter->format(); $row['orig_length'] = $formatter->format();
// XSS exploit prevention // XSS exploit prevention
$row['track_title'] = htmlspecialchars($row['track_title']); $row['track_title'] = htmlspecialchars($row['track_title'] ?? '');
$row['creator'] = htmlspecialchars($row['creator']); $row['creator'] = htmlspecialchars($row['creator'] ?? '');
} }
return $rows; return $rows;

View File

@ -232,7 +232,7 @@ class Application_Model_ShowBuilder
$row['endDate'] = $showEndDT->format('Y-m-d'); $row['endDate'] = $showEndDT->format('Y-m-d');
$row['endTime'] = $showEndDT->format('H:i'); $row['endTime'] = $showEndDT->format('H:i');
$row['duration'] = floatval($showEndDT->format('U.u')) - floatval($showStartDT->format('U.u')); $row['duration'] = floatval($showEndDT->format('U.u')) - floatval($showStartDT->format('U.u'));
$row['title'] = htmlspecialchars($p_item['show_name']); $row['title'] = htmlspecialchars($p_item['show_name'] ?? '');
$row['instance'] = intval($p_item['si_id']); $row['instance'] = intval($p_item['si_id']);
$row['image'] = ''; $row['image'] = '';
@ -283,9 +283,9 @@ class Application_Model_ShowBuilder
$formatter = new LengthFormatter(Application_Common_DateHelper::secondsToPlaylistTime($run_time)); $formatter = new LengthFormatter(Application_Common_DateHelper::secondsToPlaylistTime($run_time));
$row['runtime'] = $formatter->format(); $row['runtime'] = $formatter->format();
$row['title'] = htmlspecialchars($p_item['file_track_title']); $row['title'] = htmlspecialchars($p_item['file_track_title'] ?? '');
$row['creator'] = htmlspecialchars($p_item['file_artist_name']); $row['creator'] = htmlspecialchars($p_item['file_artist_name'] ?? '');
$row['album'] = htmlspecialchars($p_item['file_album_title']); $row['album'] = htmlspecialchars($p_item['file_album_title'] ?? '');
$row['cuein'] = $p_item['cue_in']; $row['cuein'] = $p_item['cue_in'];
$row['cueout'] = $p_item['cue_out']; $row['cueout'] = $p_item['cue_out'];

View File

@ -12,7 +12,7 @@ class CcBlock extends BaseCcBlock
/** /**
* Get the [optionally formatted] temporal [utime] column value. * Get the [optionally formatted] temporal [utime] column value.
* *
* @param string $format The date/time format string (either date()-style or strftime()-style). * @param string $format The date/time format string (either date()-style).
* If format is NULL, then the raw DateTime object will be returned. * If format is NULL, then the raw DateTime object will be returned.
* *
* @return mixed Formatted date/time value as string or DateTime object (if format is NULL), NULL if column is NULL * @return mixed Formatted date/time value as string or DateTime object (if format is NULL), NULL if column is NULL
@ -36,7 +36,7 @@ class CcBlock extends BaseCcBlock
return $dt; return $dt;
} }
if (strpos($format, '%') !== false) { if (strpos($format, '%') !== false) {
return strftime($format, $dt->format('U')); throw new PropelException('strftime format not supported anymore');
} }
return $dt->format($format); return $dt->format($format);
@ -45,7 +45,7 @@ class CcBlock extends BaseCcBlock
/** /**
* Get the [optionally formatted] temporal [mtime] column value. * Get the [optionally formatted] temporal [mtime] column value.
* *
* @param string $format The date/time format string (either date()-style or strftime()-style). * @param string $format The date/time format string (either date()-style).
* If format is NULL, then the raw DateTime object will be returned. * If format is NULL, then the raw DateTime object will be returned.
* *
* @return mixed Formatted date/time value as string or DateTime object (if format is NULL), NULL if column is NULL * @return mixed Formatted date/time value as string or DateTime object (if format is NULL), NULL if column is NULL
@ -69,7 +69,7 @@ class CcBlock extends BaseCcBlock
return $dt; return $dt;
} }
if (strpos($format, '%') !== false) { if (strpos($format, '%') !== false) {
return strftime($format, $dt->format('U')); throw new PropelException('strftime format not supported anymore');
} }
return $dt->format($format); return $dt->format($format);

View File

@ -12,7 +12,7 @@ class CcPlaylist extends BaseCcPlaylist
/** /**
* Get the [optionally formatted] temporal [utime] column value. * Get the [optionally formatted] temporal [utime] column value.
* *
* @param string $format The date/time format string (either date()-style or strftime()-style). * @param string $format The date/time format string (date()-style).
* If format is NULL, then the raw DateTime object will be returned. * If format is NULL, then the raw DateTime object will be returned.
* *
* @return mixed Formatted date/time value as string or DateTime object (if format is NULL), NULL if column is NULL * @return mixed Formatted date/time value as string or DateTime object (if format is NULL), NULL if column is NULL
@ -36,7 +36,7 @@ class CcPlaylist extends BaseCcPlaylist
return $dt; return $dt;
} }
if (strpos($format, '%') !== false) { if (strpos($format, '%') !== false) {
return strftime($format, $dt->format('U')); throw new PropelException('strftime format not supported anymore');
} }
return $dt->format($format); return $dt->format($format);
@ -45,7 +45,7 @@ class CcPlaylist extends BaseCcPlaylist
/** /**
* Get the [optionally formatted] temporal [mtime] column value. * Get the [optionally formatted] temporal [mtime] column value.
* *
* @param string $format The date/time format string (either date()-style or strftime()-style). * @param string $format The date/time format string (date()-style).
* If format is NULL, then the raw DateTime object will be returned. * If format is NULL, then the raw DateTime object will be returned.
* *
* @return mixed Formatted date/time value as string or DateTime object (if format is NULL), NULL if column is NULL * @return mixed Formatted date/time value as string or DateTime object (if format is NULL), NULL if column is NULL
@ -69,7 +69,7 @@ class CcPlaylist extends BaseCcPlaylist
return $dt; return $dt;
} }
if (strpos($format, '%') !== false) { if (strpos($format, '%') !== false) {
return strftime($format, $dt->format('U')); throw new PropelException('strftime format not supported anymore');
} }
return $dt->format($format); return $dt->format($format);

View File

@ -12,7 +12,7 @@ class CcSchedule extends BaseCcSchedule
/** /**
* Get the [optionally formatted] temporal [starts] column value. * Get the [optionally formatted] temporal [starts] column value.
* *
* @param string $format The date/time format string (either date()-style or strftime()-style). * @param string $format The date/time format string (date()-style).
* If format is NULL, then the raw DateTime object will be returned. * If format is NULL, then the raw DateTime object will be returned.
* *
* @return mixed Formatted date/time value as string or DateTime object (if format is NULL), NULL if column is NULL * @return mixed Formatted date/time value as string or DateTime object (if format is NULL), NULL if column is NULL
@ -36,7 +36,7 @@ class CcSchedule extends BaseCcSchedule
return $dt; return $dt;
} }
if (strpos($format, '%') !== false) { if (strpos($format, '%') !== false) {
return strftime($format, $dt->format('U')); throw new PropelException('strftime format not supported anymore');
} }
return $dt->format($format); return $dt->format($format);
@ -45,7 +45,7 @@ class CcSchedule extends BaseCcSchedule
/** /**
* Get the [optionally formatted] temporal [ends] column value. * Get the [optionally formatted] temporal [ends] column value.
* *
* @param string $format The date/time format string (either date()-style or strftime()-style). * @param string $format The date/time format string (date()-style).
* If format is NULL, then the raw DateTime object will be returned. * If format is NULL, then the raw DateTime object will be returned.
* *
* @return mixed Formatted date/time value as string or DateTime object (if format is NULL), NULL if column is NULL * @return mixed Formatted date/time value as string or DateTime object (if format is NULL), NULL if column is NULL
@ -69,7 +69,7 @@ class CcSchedule extends BaseCcSchedule
return $dt; return $dt;
} }
if (strpos($format, '%') !== false) { if (strpos($format, '%') !== false) {
return strftime($format, $dt->format('U')); throw new PropelException('strftime format not supported anymore');
} }
return $dt->format($format); return $dt->format($format);

View File

@ -12,7 +12,7 @@ class CcShowInstances extends BaseCcShowInstances
/** /**
* Get the [optionally formatted] temporal [starts] column value. * Get the [optionally formatted] temporal [starts] column value.
* *
* @param string $format The date/time format string (either date()-style or strftime()-style). * @param string $format The date/time format string (date()-style).
* If format is NULL, then the raw DateTime object will be returned. * If format is NULL, then the raw DateTime object will be returned.
* *
* @return mixed Formatted date/time value as string or DateTime object (if format is NULL), NULL if column is NULL * @return mixed Formatted date/time value as string or DateTime object (if format is NULL), NULL if column is NULL
@ -36,7 +36,7 @@ class CcShowInstances extends BaseCcShowInstances
return $dt; return $dt;
} }
if (strpos($format, '%') !== false) { if (strpos($format, '%') !== false) {
return strftime($format, $dt->format('U')); throw new PropelException('strftime format not supported anymore');
} }
return $dt->format($format); return $dt->format($format);
@ -45,7 +45,7 @@ class CcShowInstances extends BaseCcShowInstances
/** /**
* Get the [optionally formatted] temporal [ends] column value. * Get the [optionally formatted] temporal [ends] column value.
* *
* @param string $format The date/time format string (either date()-style or strftime()-style). * @param string $format The date/time format string (date()-style).
* If format is NULL, then the raw DateTime object will be returned. * If format is NULL, then the raw DateTime object will be returned.
* *
* @return mixed Formatted date/time value as string or DateTime object (if format is NULL), NULL if column is NULL * @return mixed Formatted date/time value as string or DateTime object (if format is NULL), NULL if column is NULL
@ -69,7 +69,7 @@ class CcShowInstances extends BaseCcShowInstances
return $dt; return $dt;
} }
if (strpos($format, '%') !== false) { if (strpos($format, '%') !== false) {
return strftime($format, $dt->format('U')); throw new PropelException('strftime format not supported anymore');
} }
return $dt->format($format); return $dt->format($format);
@ -78,7 +78,7 @@ class CcShowInstances extends BaseCcShowInstances
/** /**
* Get the [optionally formatted] temporal [last_scheduled] column value. * Get the [optionally formatted] temporal [last_scheduled] column value.
* *
* @param string $format The date/time format string (either date()-style or strftime()-style). * @param string $format The date/time format string (date()-style).
* If format is NULL, then the raw DateTime object will be returned. * If format is NULL, then the raw DateTime object will be returned.
* *
* @return mixed Formatted date/time value as string or DateTime object (if format is NULL), NULL if column is NULL * @return mixed Formatted date/time value as string or DateTime object (if format is NULL), NULL if column is NULL
@ -102,7 +102,7 @@ class CcShowInstances extends BaseCcShowInstances
return $dt; return $dt;
} }
if (strpos($format, '%') !== false) { if (strpos($format, '%') !== false) {
return strftime($format, $dt->format('U')); throw new PropelException('strftime format not supported anymore');
} }
return $dt->format($format); return $dt->format($format);

View File

@ -207,7 +207,7 @@ abstract class BaseCcAccess extends BaseObject implements Persistent
* Get the [optionally formatted] temporal [ts] column value. * Get the [optionally formatted] temporal [ts] column value.
* *
* *
* @param string $format The date/time format string (either date()-style or strftime()-style). * @param string $format The date/time format string (date()-style).
* If format is NULL, then the raw DateTime object will be returned. * If format is NULL, then the raw DateTime object will be returned.
* @return mixed Formatted date/time value as string or DateTime object (if format is NULL), NULL if column is NULL * @return mixed Formatted date/time value as string or DateTime object (if format is NULL), NULL if column is NULL
* @throws PropelException - if unable to parse/validate the date/time value. * @throws PropelException - if unable to parse/validate the date/time value.
@ -230,7 +230,7 @@ abstract class BaseCcAccess extends BaseObject implements Persistent
// Because propel.useDateTimeClass is TRUE, we return a DateTime object. // Because propel.useDateTimeClass is TRUE, we return a DateTime object.
return $dt; return $dt;
} elseif (strpos($format, '%') !== false) { } elseif (strpos($format, '%') !== false) {
return strftime($format, $dt->format('U')); throw new PropelException('strftime format not supported anymore');
} else { } else {
return $dt->format($format); return $dt->format($format);
} }

View File

@ -102,7 +102,7 @@ abstract class BaseCcBackup extends BaseObject implements Persistent
* Get the [optionally formatted] temporal [fromtime] column value. * Get the [optionally formatted] temporal [fromtime] column value.
* *
* *
* @param string $format The date/time format string (either date()-style or strftime()-style). * @param string $format The date/time format string (date()-style).
* If format is NULL, then the raw DateTime object will be returned. * If format is NULL, then the raw DateTime object will be returned.
* @return mixed Formatted date/time value as string or DateTime object (if format is NULL), NULL if column is NULL * @return mixed Formatted date/time value as string or DateTime object (if format is NULL), NULL if column is NULL
* @throws PropelException - if unable to parse/validate the date/time value. * @throws PropelException - if unable to parse/validate the date/time value.
@ -125,7 +125,7 @@ abstract class BaseCcBackup extends BaseObject implements Persistent
// Because propel.useDateTimeClass is TRUE, we return a DateTime object. // Because propel.useDateTimeClass is TRUE, we return a DateTime object.
return $dt; return $dt;
} elseif (strpos($format, '%') !== false) { } elseif (strpos($format, '%') !== false) {
return strftime($format, $dt->format('U')); throw new PropelException('strftime format not supported anymore');
} else { } else {
return $dt->format($format); return $dt->format($format);
} }
@ -135,7 +135,7 @@ abstract class BaseCcBackup extends BaseObject implements Persistent
* Get the [optionally formatted] temporal [totime] column value. * Get the [optionally formatted] temporal [totime] column value.
* *
* *
* @param string $format The date/time format string (either date()-style or strftime()-style). * @param string $format The date/time format string (date()-style).
* If format is NULL, then the raw DateTime object will be returned. * If format is NULL, then the raw DateTime object will be returned.
* @return mixed Formatted date/time value as string or DateTime object (if format is NULL), NULL if column is NULL * @return mixed Formatted date/time value as string or DateTime object (if format is NULL), NULL if column is NULL
* @throws PropelException - if unable to parse/validate the date/time value. * @throws PropelException - if unable to parse/validate the date/time value.
@ -158,7 +158,7 @@ abstract class BaseCcBackup extends BaseObject implements Persistent
// Because propel.useDateTimeClass is TRUE, we return a DateTime object. // Because propel.useDateTimeClass is TRUE, we return a DateTime object.
return $dt; return $dt;
} elseif (strpos($format, '%') !== false) { } elseif (strpos($format, '%') !== false) {
return strftime($format, $dt->format('U')); throw new PropelException('strftime format not supported anymore');
} else { } else {
return $dt->format($format); return $dt->format($format);
} }

View File

@ -428,7 +428,7 @@ abstract class BaseCcTrans extends BaseObject implements Persistent
* Get the [optionally formatted] temporal [start] column value. * Get the [optionally formatted] temporal [start] column value.
* *
* *
* @param string $format The date/time format string (either date()-style or strftime()-style). * @param string $format The date/time format string (date()-style).
* If format is NULL, then the raw DateTime object will be returned. * If format is NULL, then the raw DateTime object will be returned.
* @return mixed Formatted date/time value as string or DateTime object (if format is NULL), NULL if column is NULL * @return mixed Formatted date/time value as string or DateTime object (if format is NULL), NULL if column is NULL
* @throws PropelException - if unable to parse/validate the date/time value. * @throws PropelException - if unable to parse/validate the date/time value.
@ -451,7 +451,7 @@ abstract class BaseCcTrans extends BaseObject implements Persistent
// Because propel.useDateTimeClass is TRUE, we return a DateTime object. // Because propel.useDateTimeClass is TRUE, we return a DateTime object.
return $dt; return $dt;
} elseif (strpos($format, '%') !== false) { } elseif (strpos($format, '%') !== false) {
return strftime($format, $dt->format('U')); throw new PropelException('strftime format not supported anymore');
} else { } else {
return $dt->format($format); return $dt->format($format);
} }
@ -461,7 +461,7 @@ abstract class BaseCcTrans extends BaseObject implements Persistent
* Get the [optionally formatted] temporal [ts] column value. * Get the [optionally formatted] temporal [ts] column value.
* *
* *
* @param string $format The date/time format string (either date()-style or strftime()-style). * @param string $format The date/time format string (date()-style).
* If format is NULL, then the raw DateTime object will be returned. * If format is NULL, then the raw DateTime object will be returned.
* @return mixed Formatted date/time value as string or DateTime object (if format is NULL), NULL if column is NULL * @return mixed Formatted date/time value as string or DateTime object (if format is NULL), NULL if column is NULL
* @throws PropelException - if unable to parse/validate the date/time value. * @throws PropelException - if unable to parse/validate the date/time value.
@ -484,7 +484,7 @@ abstract class BaseCcTrans extends BaseObject implements Persistent
// Because propel.useDateTimeClass is TRUE, we return a DateTime object. // Because propel.useDateTimeClass is TRUE, we return a DateTime object.
return $dt; return $dt;
} elseif (strpos($format, '%') !== false) { } elseif (strpos($format, '%') !== false) {
return strftime($format, $dt->format('U')); throw new PropelException('strftime format not supported anymore');
} else { } else {
return $dt->format($format); return $dt->format($format);
} }

View File

@ -135,7 +135,7 @@ class Application_Service_MediaService
*/ */
public static function areFilesStuckInPending() public static function areFilesStuckInPending()
{ {
$oneHourAgo = gmdate(DEFAULT_TIMESTAMP_FORMAT, microtime(true) - self::PENDING_FILE_TIMEOUT_SECONDS); $oneHourAgo = gmdate(DEFAULT_TIMESTAMP_FORMAT, intval(microtime(true)) - self::PENDING_FILE_TIMEOUT_SECONDS);
self::$_pendingFiles = CcFilesQuery::create() self::$_pendingFiles = CcFilesQuery::create()
->filterByDbImportStatus(CcFiles::IMPORT_STATUS_PENDING) ->filterByDbImportStatus(CcFiles::IMPORT_STATUS_PENDING)
->filterByDbUtime($oneHourAgo, Criteria::LESS_EQUAL) ->filterByDbUtime($oneHourAgo, Criteria::LESS_EQUAL)

View File

@ -292,7 +292,7 @@ class Application_Service_PodcastEpisodeService extends Application_Service_Thir
*/ */
public static function getStuckPendingImports() public static function getStuckPendingImports()
{ {
$timeout = gmdate(DEFAULT_TIMESTAMP_FORMAT, microtime(true) - self::PENDING_EPISODE_TIMEOUT_SECONDS); $timeout = gmdate(DEFAULT_TIMESTAMP_FORMAT, intval(microtime(true)) - self::PENDING_EPISODE_TIMEOUT_SECONDS);
$episodes = PodcastEpisodesQuery::create() $episodes = PodcastEpisodesQuery::create()
->filterByDbFileId() ->filterByDbFileId()
->find(); ->find();
@ -481,7 +481,7 @@ class Application_Service_PodcastEpisodeService extends Application_Service_Thir
// From the RSS spec best practices: // From the RSS spec best practices:
// 'An item's author element provides the e-mail address of the person who wrote the item' // 'An item's author element provides the e-mail address of the person who wrote the item'
'author' => $this->_buildAuthorString($item), 'author' => $this->_buildAuthorString($item),
'description' => htmlspecialchars($item->get_description()), 'description' => htmlspecialchars($item->get_description() ?? ''),
'pub_date' => $item->get_gmdate(), 'pub_date' => $item->get_gmdate(),
'link' => $url, 'link' => $url,
'enclosure' => $enclosure, 'enclosure' => $enclosure,

View File

@ -62,15 +62,15 @@ class Application_Service_PodcastService
$podcastArray = []; $podcastArray = [];
$podcastArray['url'] = $feedUrl; $podcastArray['url'] = $feedUrl;
$podcastArray['title'] = htmlspecialchars($rss->get_title()); $podcastArray['title'] = htmlspecialchars($rss->get_title() ?? '');
$podcastArray['description'] = htmlspecialchars($rss->get_description()); $podcastArray['description'] = htmlspecialchars($rss->get_description() ?? '');
$podcastArray['link'] = htmlspecialchars($rss->get_link()); $podcastArray['link'] = htmlspecialchars($rss->get_link() ?? '');
$podcastArray['language'] = htmlspecialchars($rss->get_language()); $podcastArray['language'] = htmlspecialchars($rss->get_language() ?? '');
$podcastArray['copyright'] = htmlspecialchars($rss->get_copyright()); $podcastArray['copyright'] = htmlspecialchars($rss->get_copyright() ?? '');
$author = $rss->get_author(); $author = $rss->get_author();
$name = empty($author) ? '' : $author->get_name(); $name = empty($author) ? '' : $author->get_name();
$podcastArray['creator'] = htmlspecialchars($name); $podcastArray['creator'] = htmlspecialchars($name ?? '');
$categories = []; $categories = [];
if (is_array($rss->get_categories())) { if (is_array($rss->get_categories())) {
@ -432,7 +432,7 @@ class Application_Service_PodcastService
$imageUrl = Config::getPublicUrl() . 'api/station-logo'; $imageUrl = Config::getPublicUrl() . 'api/station-logo';
$image = $channel->addChild('image'); $image = $channel->addChild('image');
$image->addChild('title', htmlspecialchars($podcast->getDbTitle())); $image->addChild('title', htmlspecialchars($podcast->getDbTitle() ?? ''));
self::addEscapedChild($image, 'url', $imageUrl); self::addEscapedChild($image, 'url', $imageUrl);
self::addEscapedChild($image, 'link', Config::getPublicUrl()); self::addEscapedChild($image, 'link', Config::getPublicUrl());

2
legacy/composer.lock generated
View File

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"content-hash": "99a8bfaf51b5e36bb702f789ce200fea", "content-hash": "3664fa9473d4b70e3c383b59ca794c82",
"packages": [ "packages": [
{ {
"name": "adbario/php-dot-notation", "name": "adbario/php-dot-notation",