@@ -1133,7 +1133,15 @@ function internalUpdatePlaylist($songs, $count, $length)
1133
1133
$ plId = $ db ->insert_id ();
1134
1134
if ($ plId )
1135
1135
{
1136
- setcookie ('mp3act_playlist_id ' , $ plId , time ()+MYTH_PLAYLIST_SAVE_TIME );
1136
+ if (PHP_VERSION_ID < 70300 ) {
1137
+ setcookie ('mp3act_playlist_id ' , $ plId , time ()+MYTH_PLAYLIST_SAVE_TIME , '/; SameSite=Strict ' );
1138
+ } else {
1139
+ setcookie ('mp3act_playlist_id ' , $ plId , [
1140
+ 'expires ' => time ()+MYTH_PLAYLIST_SAVE_TIME ,
1141
+ 'path ' => '/ ' ,
1142
+ 'samesite ' => 'Strict '
1143
+ ]);
1144
+ }
1137
1145
return $ plId ;
1138
1146
}
1139
1147
}
@@ -1272,7 +1280,15 @@ function clearPlaylist()
1272
1280
$ pl = internalGetPlaylist ();
1273
1281
1274
1282
// Trash the cookie (empties the playlist)
1275
- setcookie ('mp3act_playlist_id ' , false , time ()-3600 );
1283
+ if (PHP_VERSION_ID < 70300 ) {
1284
+ setcookie ('mp3act_playlist_id ' , false , time ()-3600 , '/; SameSite=Strict ' );
1285
+ } else {
1286
+ setcookie ('mp3act_playlist_id ' , false , [
1287
+ 'expires ' => time ()-3600 ,
1288
+ 'path ' => '/ ' ,
1289
+ 'samesite ' => 'Strict '
1290
+ ]);
1291
+ }
1276
1292
1277
1293
if (!empty ($ pl ['playlist_name ' ])
1278
1294
&& MYTH_WEB_PLAYLIST_NAME == $ pl ['playlist_name ' ])
@@ -1291,7 +1307,15 @@ function deletePlaylist($id)
1291
1307
if ($ id == $ _COOKIE ['mp3act_playlist_id ' ])
1292
1308
{
1293
1309
$ rv = 1 ;
1294
- setcookie ('mp3act_playlist_id ' , false , time ()-3600 );
1310
+ if (PHP_VERSION_ID < 70300 ) {
1311
+ setcookie ('mp3act_playlist_id ' , false , time ()-3600 , '/; SameSite=Strict ' );
1312
+ } else {
1313
+ setcookie ('mp3act_playlist_id ' , false , [
1314
+ 'expires ' => time ()-3600 ,
1315
+ 'path ' => '/ ' ,
1316
+ 'samesite ' => 'Strict '
1317
+ ]);
1318
+ }
1295
1319
}
1296
1320
1297
1321
$ query = 'DELETE FROM music_playlists ' .
@@ -1416,7 +1440,15 @@ function playlist_add($type, $itemid)
1416
1440
if ('loadplaylist ' == $ type )
1417
1441
{
1418
1442
clearPlaylist ();
1419
- setcookie ('mp3act_playlist_id ' , $ itemid , time ()+MYTH_PLAYLIST_SAVE_TIME );
1443
+ if (PHP_VERSION_ID < 70300 ) {
1444
+ setcookie ('mp3act_playlist_id ' , $ itemid , time ()+MYTH_PLAYLIST_SAVE_TIME , '/; SameSite=Strict ' );
1445
+ } else {
1446
+ setcookie ('mp3act_playlist_id ' , $ itemid , [
1447
+ 'expires ' => time ()+MYTH_PLAYLIST_SAVE_TIME ,
1448
+ 'path ' => '/ ' ,
1449
+ 'samesite ' => 'Strict '
1450
+ ]);
1451
+ }
1420
1452
$ output [0 ] = 1 ;
1421
1453
return $ output ;
1422
1454
}
0 commit comments