Jack Phoenix has submitted this change and it was merged.

Change subject: Support the pixel unit (px) in height/width parameters, because 
apparently a lot of people use it there.
......................................................................


Support the pixel unit (px) in height/width parameters, because apparently
a lot of people use it there.

And apparently it was supported before I changed the settype()s to
filter_var()s.

Change-Id: Ia4b176a73601a1ab62cd949809e60c071f1f4676
---
M YouTube.php
1 file changed, 13 insertions(+), 0 deletions(-)

Approvals:
  Jack Phoenix: Verified; Looks good to me, approved



diff --git a/YouTube.php b/YouTube.php
index dc75957..6bdbdfb 100644
--- a/YouTube.php
+++ b/YouTube.php
@@ -99,6 +99,19 @@
                return '';
        }
 
+       // Support the pixel unit (px) in height/width parameters, because 
apparently
+       // a lot of people use it there.
+       // This way these parameters won't fail the filter_var() tests below if 
the
+       // user-supplied values were like 450px or 200px or something instead of
+       // 450 or 200
+       if ( !empty( $argv['height'] ) ) {
+               $argv['height'] = str_replace( 'px', '', $argv['height'] );
+       }
+
+       if ( !empty( $argv['width'] ) ) {
+               $argv['width'] = str_replace( 'px', '', $argv['width'] );
+       }
+
        // Which technology to use for embedding -- HTML5 or Flash Player?
        if ( !empty( $argv['type'] ) && strtolower( $argv['type'] ) == 'flash' 
) {
                $width = $width_max = 425;

-- 
To view, visit https://gerrit.wikimedia.org/r/105633
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ia4b176a73601a1ab62cd949809e60c071f1f4676
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/YouTube
Gerrit-Branch: master
Gerrit-Owner: Jack Phoenix <[email protected]>
Gerrit-Reviewer: Jack Phoenix <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to