Fix undefined UrlOembed provider pattern (#5662)

* Fix undefined UrlOembed provider pattern

* Update CHANGELOG.md (#5652)

Co-authored-by: Lucas Bartholemy <luke-@users.noreply.github.com>
This commit is contained in:
Yuriy Bakhtin 2022-05-03 18:16:03 +03:00 committed by GitHub
parent 2eccd0422d
commit 709b35fed7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -1,9 +1,9 @@
HumHub Changelog
================
1.11.2 (Unreleased)
-------------------
-----------------------
- Fix: #5652: Fix undefined UrlOembed provider pattern
- Fix #5660: Individual modules marked with "Official" label in Marketplace
- Fix #5657: Fix links of user counters in container headers

View File

@ -118,7 +118,7 @@ class UrlOembed extends ActiveRecord
public function getProviderUrl()
{
foreach (static::getProviders() as $provider) {
if (preg_match($provider['pattern'], $this->url)) {
if (isset($provider['pattern']) && preg_match($provider['pattern'], $this->url)) {
return str_replace("%url%", urlencode($this->url), $provider['endpoint']);
}
}
@ -362,7 +362,7 @@ class UrlOembed extends ActiveRecord
public static function getProviderByUrl($url)
{
foreach (static::getProviders() as $provider) {
if (preg_match($provider['pattern'], $url)) {
if (isset($provider['pattern']) && preg_match($provider['pattern'], $url)) {
return $provider['endpoint'];
}
}