Skip to content

Commit e37499e

Browse files
michalsnsamsonasik
andcommitted
apply code suggestions
Co-authored-by: Abdul Malik Ikhsan <[email protected]>
1 parent f695fa7 commit e37499e

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

app/Helpers/video_helper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ function embedVideo(string $code, string $width = '640', string $height = '385')
3737
$code = $result['v'] ?? null;
3838
}
3939

40-
if (isset($code) && ($code !== '' && $code !== '0' && $code !== [])) {
40+
if (! in_array($code, ['', null, '0', []], true)) {
4141
return '
4242
<iframe width="' . $width . '" height="' . $height . '"
4343
src="https://www.youtube.com/embed/' . $code . '" frameborder="0"

app/Libraries/Blog.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ protected function parseVideoTags(?string $html = null)
297297
// ![[ https://youtube.com/watch?v=xlkjsdfhlk ]]
298298
$result = preg_match_all('|!video\[([\s\w:/.?=&;]*)\]|i', $html, $matches);
299299

300-
if ($result === false || $result === 0) {
300+
if ($result < 1) {
301301
return $html;
302302
}
303303

0 commit comments

Comments
 (0)