Version 1.5.3 introduces PHP 5.4+ dependency
-
[Mon Jun 26 14:21:00 2017] [error] [client 38.140.159.10] PHP Parse error: syntax error, unexpected '[' in /var/www/html/blog/wp-content/plugins/featured-image-from-url/includes/external-post.php on line 70
Fix:
--- external-post.php~ 2017-06-26 14:20:11.583030262 +0000 +++ external-post.php 2017-06-26 14:24:20.308361745 +0000 @@ -67,5 +67,7 @@ $content = get_post_field('post_content', $post_id); $matches = array(); preg_match_all('/<img[^>]*>/', $content, $matches); - return $matches && $matches[0] ? explode('"', explode('src="', $matches[0][0])[1])[0] : null; + $exp1 = explode('src="', $matches[0][0]); + $exp2 = explode('"', $exp1[1]); + return $matches && $matches[0] ? $exp2[0] : null; }
Some of us are on still-supported OS releases that haven’t upgraded to PHP 5.4+. :-/
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Version 1.5.3 introduces PHP 5.4+ dependency’ is closed to new replies.