Skip to content

Commit 91af2b2

Browse files
committed
Merge remote-tracking branch 'origin/master'
2 parents a542e58 + c84b394 commit 91af2b2

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

system/application/helpers/MY_html_helper.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
function first_og_image_from_html_string($str='') {
44

5+
if (empty($str)) return false;
56
$urls = hrefs_from_html_string($str);
67
foreach ($urls as $url) {
78
if (is_opengraphable_image($url)) {
@@ -14,6 +15,7 @@ function first_og_image_from_html_string($str='') {
1415

1516
function is_opengraphable_image($url) {
1617

18+
if (empty($url)) return false;
1719
if (strtolower(substr($url, -4, 4)) == '.jpg' || strtolower(substr($url, -4, 4)) == '.png' || strtolower(substr($url, -4, 4)) == 'jpeg') {
1820
return true;
1921
}

0 commit comments

Comments
 (0)