Skip to content

Commit

Permalink
Fixes issue where only one custom field was being output when multipl…
Browse files Browse the repository at this point in the history
…e were specified in the custom list html. Closes #95
  • Loading branch information
Kyle Phillips committed Nov 21, 2018
1 parent 2af84a2 commit 508170e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
6 changes: 4 additions & 2 deletions app/Entities/FavoriteList/FavoriteListingPresenter.php
Original file line number Diff line number Diff line change
Expand Up @@ -131,10 +131,12 @@ private function getThumbnail($size)
*/
private function replaceCustomFields()
{
preg_match("/\[[^\]]*\]/", $this->html, $out);
foreach($out as $field){
preg_match_all("/\[[^\]]*\]/", $this->html, $out);
if ( empty($out) ) return;
foreach($out[0] as $field){
$field_bracketed = $field;
$key = str_replace('[', '', $field);
$key = str_replace('custom_field:', '', $key);
$key = str_replace(']', '', $key);
$meta = get_post_meta($this->favorite, $key, true);
if ( !$meta ) $meta = '';
Expand Down
3 changes: 3 additions & 0 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@ As of version 1.1.0, Favorites is compatible with multisite installations. By de

== Changelog ==

= 2.3.1 =
* Bug Fix: Fixes issue where only one custom field was being output when multiple were specified in the custom list html.

= 2.3.0 =
* Security Update: Removes ability for users to manipulate favorites belonging to other users. Thanks to Arne van Hoorn for uncovering this issue.

Expand Down

0 comments on commit 508170e

Please sign in to comment.