Skip to content

Commit

Permalink
fix: Improve logic for handling array parameters in oEmbed service.
Browse files Browse the repository at this point in the history
  • Loading branch information
reganlawton committed Dec 8, 2023
1 parent 9c54dab commit eb87b2c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/services/OembedService.php
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,11 @@ public function embed($url, array $options = [], array $cacheProps = [])

if (!empty($options['params'])) {
foreach ((array)$options['params'] as $key => $value) {
// If value is an array, skip
if (is_array($value)) {
continue;
}

$src = preg_replace('/\?(.*)$/i', '?' . $key . '=' . $value . '&${1}', $src);
}
}
Expand Down

0 comments on commit eb87b2c

Please sign in to comment.