mirror of
https://code.castopod.org/adaures/castopod
synced 2025-05-31 22:42:00 +00:00
fix: correct php-fpm issues
This commit is contained in:
parent
cbc5d0891d
commit
1ef55d7315
app
@ -6,6 +6,30 @@
|
|||||||
* @link https://castopod.org/
|
* @link https://castopod.org/
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* For compatibility with PHP-FPM v7.2 and below:
|
||||||
|
*/
|
||||||
|
if (!function_exists('getallheaders')) {
|
||||||
|
function getallheaders()
|
||||||
|
{
|
||||||
|
$headers = [];
|
||||||
|
foreach ($_SERVER as $name => $value) {
|
||||||
|
if (substr($name, 0, 5) == 'HTTP_') {
|
||||||
|
$headers[
|
||||||
|
str_replace(
|
||||||
|
' ',
|
||||||
|
'-',
|
||||||
|
ucwords(
|
||||||
|
strtolower(str_replace('_', ' ', substr($name, 5)))
|
||||||
|
)
|
||||||
|
)
|
||||||
|
] = $value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $headers;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set user country in session variable, for analytics purpose
|
* Set user country in session variable, for analytics purpose
|
||||||
*/
|
*/
|
||||||
|
@ -270,7 +270,7 @@ class EpisodeModel extends Model
|
|||||||
$sortNumberField =
|
$sortNumberField =
|
||||||
$podcastType == 'serial'
|
$podcastType == 'serial'
|
||||||
? 'if(isnull(season_number),0,season_number)*1000+number'
|
? 'if(isnull(season_number),0,season_number)*1000+number'
|
||||||
: 'UNIX_TIMESTAMP(published_at)';
|
: 'published_at';
|
||||||
$sortNumberValue =
|
$sortNumberValue =
|
||||||
$podcastType == 'serial'
|
$podcastType == 'serial'
|
||||||
? (empty($episode->season_number)
|
? (empty($episode->season_number)
|
||||||
@ -278,7 +278,7 @@ class EpisodeModel extends Model
|
|||||||
: $episode->season_number) *
|
: $episode->season_number) *
|
||||||
1000 +
|
1000 +
|
||||||
$episode->number
|
$episode->number
|
||||||
: strtotime($episode->published_at);
|
: $episode->published_at;
|
||||||
|
|
||||||
$previousData = $this->orderBy('(' . $sortNumberField . ') DESC')
|
$previousData = $this->orderBy('(' . $sortNumberField . ') DESC')
|
||||||
->where([
|
->where([
|
||||||
|
Loading…
x
Reference in New Issue
Block a user