Corrected video ratio management (once again).
This commit is contained in:
parent
638e5c9195
commit
ec66264d81
|
@ -156,7 +156,7 @@ __test_cases = {
|
|||
'<p>[video]<script>alert(document.cookie)</script>' \
|
||||
'[/video]</p>',
|
||||
'[video]https://www.youtube.com/watch?v=6odDOOyUawY[/video]': \
|
||||
'<div class="video-wrapper"><iframe ' \
|
||||
'<div class="video-wrapper" style="padding-bottom: 56.25%"><iframe ' \
|
||||
'src="https://www.youtube.com/embed/6odDOOyUawY" ' \
|
||||
'frameborder="0" allowfullscreen></iframe></div>',
|
||||
'[video]https://www.youtube.com/watch?v=<script>alert(1)</script>': \
|
||||
|
|
|
@ -97,7 +97,7 @@ class VideoTag(_BlockTag):
|
|||
elif hasattr(self._video, 'ratio'):
|
||||
ratio = self._video.ratio * 100
|
||||
else:
|
||||
ratio = round(_defaultratio_w / _defaultratio_h, 4)
|
||||
ratio = round(_defaultratio_h / _defaultratio_w, 4) * 100
|
||||
iratio = int(ratio)
|
||||
if ratio == iratio:
|
||||
ratio = iratio
|
||||
|
|
Loading…
Reference in New Issue