Skip to content

Commit

Permalink
Fixed two PHP warnings due to lack of array index. Props for [Leonidas](
Browse files Browse the repository at this point in the history
  • Loading branch information
iworks committed Nov 8, 2022
1 parent 1d37236 commit 5be7a50
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
5 changes: 3 additions & 2 deletions includes/iworks/class-iworks-opengraph.php
Original file line number Diff line number Diff line change
Expand Up @@ -830,7 +830,7 @@ public function wp_head() {
is_array( $og['og']['image'] )
&& ! empty( $og['og']['image'] )
) {
$img = $og['og']['image'][0];
$img = reset( $og['og']['image'] );
if ( isset( $img['url'] ) ) {
$tmp_src = $img['url'];
}
Expand Down Expand Up @@ -1451,8 +1451,9 @@ private function set_twitter_image( $og ) {
if (
isset( $og['og']['image'] )
&& is_array( $og['og']['image'] )
&& ! empty( $og['og']['image'] )
) {
$img = $og['og']['image'][0];
$img = reset( $og['og']['image'] );
} else {
return $og;
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"title": "OG — Better Share on Social Media",
"tagline": "The simple method to add Open Graph metadata to your entries so that they look great when shared on sites.",
"description": "Very tiny Open Graph plugin - add featured image as facebook image. This plugin do not have any configuration - you can check how it works looking into page source.",
"version": "3.1.7",
"version": "3.1.8",
"homepage": "http://og.iworks.pl/",
"author": [
{
Expand Down
4 changes: 4 additions & 0 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,10 @@ Rich filters implementation allows to change almost every output of this plugin,

== Changelog ==


= 3.1.8 (2022-11-08) =
* Fixed two PHP warnings due to lack of array index. Props for [Leonidas](https://wordpress.org/support/users/visionoptika/).

= 3.1.7 (2022-08-16) =
* Fixed issue with [Reading Time WP](https://wordpress.org/plugins/reading-time-wp/) it returns string instead number for reading time less than 1 minute. Props for Radosław Serba.

Expand Down

0 comments on commit 5be7a50

Please sign in to comment.