File tree Expand file tree Collapse file tree 2 files changed +14
-10
lines changed Expand file tree Collapse file tree 2 files changed +14
-10
lines changed Original file line number Diff line number Diff line change 8
8
- 5.5
9
9
- 5.6
10
10
- 7.0
11
+ - 7.1
12
+ - 7.2
11
13
12
14
matrix :
13
15
include :
Original file line number Diff line number Diff line change 1
1
<?php
2
2
/**
3
- * Created by PhpStorm.
4
- * User: Ricardo Fiorani
5
- * Date: 30/08/2015
6
- * Time: 00:55.
3
+ * @author Ricardo Fiorani
7
4
*/
5
+
8
6
namespace RicardoFiorani \Renderer ;
9
7
10
8
class DefaultRenderer implements EmbedRendererInterface
@@ -13,18 +11,22 @@ class DefaultRenderer implements EmbedRendererInterface
13
11
* A friend once told me that html inside strings
14
12
* isn't a good thing, but god knows I trying
15
13
* to make it not dependant of some html element generator
16
- * and too lazy to make one of these on my own.
17
- *
18
- *
14
+ * and I'm too lazy/unnecessary to make one of these on my own.
15
+ * Edit: The best I could do is do an sprintf, so...
19
16
*
20
17
* @param string $embedUrl
21
- * @param int $width
22
- * @param int $height
18
+ * @param int $width
19
+ * @param int $height
23
20
*
24
21
* @return string
25
22
*/
26
23
public function renderVideoEmbedCode ($ embedUrl , $ width , $ height )
27
24
{
28
- return '<iframe width=" ' .$ width .'" height=" ' .$ height .'" src=" ' .addslashes ($ embedUrl ).'" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe> ' ;
25
+ return sprintf (
26
+ '<iframe width="%s" height="%s" src="%s" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe> ' ,
27
+ $ width ,
28
+ $ height ,
29
+ addslashes ($ embedUrl )
30
+ );
29
31
}
30
32
}
You can’t perform that action at this time.
0 commit comments