diff options
| author | kpcyrd <git@rxv.cc> | 2014-08-09 12:01:43 +0200 |
|---|---|---|
| committer | kpcyrd <git@rxv.cc> | 2014-08-09 12:14:12 +0200 |
| commit | bf52d416500b530bb65ccb54cdc41e5d7d6c4d51 (patch) | |
| tree | 53b1a32319c502cde06d403761b9b4bd68629e81 /player.php | |
| parent | c3662d4a59897d25aa9f676ef9e879a9f760eb2c (diff) | |
Improve type-safty in player.php
Diffstat (limited to 'player.php')
| -rw-r--r-- | player.php | 13 |
1 files changed, 8 insertions, 5 deletions
@@ -1,12 +1,15 @@ <?php /* This file is dedicated to the public domain; you may do as you wish with it. */ -$params = '?v=' . urlencode($_GET['v']) . '&t=' . urlencode($_GET['t']); -$loop = ($_GET['loop'] != "0"); +$v = (string)$_GET['v']; +$t = (string)$_GET['t']; +$loop = (boolean)$_GET['loop']; + +$params = '?v=' . urlencode($v) . '&t=' . urlencode($t); ?><!DOCTYPE html> <html> <head> <meta charset="utf-8"> - <title><?php echo htmlspecialchars($_GET['t']); ?></title> + <title><?php echo htmlspecialchars($t); ?></title> <link rel="stylesheet" href="stylesheets/webm/playerstyle.css"> <script src="js/webm-settings.js"></script> <script src="js/webm/playersettings.js"></script> @@ -17,8 +20,8 @@ $loop = ($_GET['loop'] != "0"); <a id="loop1" href="<?php echo $params; ?>&loop=1"<?php if ($loop) echo ' style="font-weight: bold"'; ?>>[loop]</a> </div> <div id="playercontent"> - <video controls<?php if ($loop) echo ' loop'; ?> src="<?php echo htmlspecialchars($_GET['v']); ?>"> - Your browser does not support HTML5 video. <a href="<?php echo htmlspecialchars($_GET['v']); ?>">[Download]</a> + <video controls<?php if ($loop) echo ' loop'; ?> src="<?php echo htmlspecialchars($v); ?>"> + Your browser does not support HTML5 video. <a href="<?php echo htmlspecialchars($v); ?>">[Download]</a> </video> </div> </body> |
