use secure_url()

This commit is contained in:
Ben Goldsworthy 2024-06-09 22:29:37 +02:00
parent 1d8fb6b407
commit 0d777d214c
Signed by: Rumperuu
SSH key fingerprint: SHA256:e5XfzNOr9UvWpEzyLfw0GtTMZWIFh3NmxH+/qQIi3xE

View file

@ -11,11 +11,11 @@
$path = "/" . $trip_slug . "/" .$hasEmbed . "/" . $filepath[1];
$embed = '<video class="popup__video" controls>';
$embed .= '<source src="' . url( $path ) . '" type="video/webm">';
$embed .= '<p>Your client doesn\'t support HTML video. Here is a <a href="' . url( $path ) . '">link to the video</a> instead.</p>';
$embed .= '<source src="' . secure_url( $path ) . '" type="video/webm">';
$embed .= '<p>Your client doesn\'t support HTML video. Here is a <a href="' . secure_url( $path ) . '">link to the video</a> instead.</p>';
$embed .= '</video>';
if (isset($email)) {
$embed .= '<p><i>If your email client doesn\'t support video embeds, here is a <a href="' . url( $path ) . '">link to the file</a> instead.</i></p>';
$embed .= '<p><i>If your email client doesn\'t support video embeds, here is a <a href="' . secure_url( $path ) . '">link to the file</a> instead.</i></p>';
}
} else {
$embed = '<p>[The video \'' . $filepath[1] . '\' has not yet been uploaded, try again later.]</p>';
@ -28,11 +28,11 @@
$path = "/" . $trip_slug . "/" .$hasEmbed . "/" . $filepath[1];
$embed = '<audio class="popup__audio" controls>';
$embed .= '<source src="' . url( $path ) . '" type="audio/ogg">';
$embed .= '<p>Download <a href="' . url( $path ) . '">OGG</a> audio.</p>';
$embed .= '<source src="' . secure_url( $path ) . '" type="audio/ogg">';
$embed .= '<p>Download <a href="' . secure_url( $path ) . '">OGG</a> audio.</p>';
$embed .= '</audio>';
if (isset($email)) {
$embed .= '<p><i>If your email client doesn\' support audio embeds, here is a <a href="' . url( $path ) . '">link to the file</a> instead.</i></p>';
$embed .= '<p><i>If your email client doesn\' support audio embeds, here is a <a href="' . secure_url( $path ) . '">link to the file</a> instead.</i></p>';
}
} else {
$embed = '<p>[The recording \'' . $filepath[1] . '\' has not yet been uploaded, try again later.]</p>';