Skip to content
This repository has been archived by the owner on May 24, 2021. It is now read-only.

Commit

Permalink
related to #33 – sanitizing enclosure data via trim()
Browse files Browse the repository at this point in the history
  • Loading branch information
gerritvanaaken committed Nov 6, 2012
1 parent 50dcb22 commit 8c7c975
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions podlove-web-player/podlove-web-player.php
Original file line number Diff line number Diff line change
Expand Up @@ -202,17 +202,11 @@ function podlove_pwp_media_shortcode($tagName, $atts) {
$attributes[] = 'type="' . $type . '"';
}

/*
if ($src) {
$attributes[] = 'src="'.htmlspecialchars($src).'"';
$flash_src = htmlspecialchars($src);
}
*/

if ($src) {

$src = trim($src);
// does it have an extension?
if (substr($src, strlen($src) - 4, 1) == '.') {
$suffixlength = strlen(substr($src, strrpos($src, ".")));
if ($suffixlength == 4 || $suffixlength == 5) {
$attributes[] = 'src="' . htmlspecialchars($src) . '"';
$flash_src = htmlspecialchars($src);
}
Expand Down

0 comments on commit 8c7c975

Please sign in to comment.