-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Some code cleanup on ParsedownGravTrait and Grav classes
- Loading branch information
Showing
2 changed files
with
32 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -449,10 +449,11 @@ public function fallbackUrl($path) | |
$supported_types = $config->get('media.types'); | ||
|
||
// Check whitelist first, then ensure extension is a valid media type | ||
if (!empty($fallback_types) && !in_array($uri_extension, $fallback_types)) { | ||
return; | ||
} elseif (!array_key_exists($uri_extension, $supported_types)) { | ||
return; | ||
if (!empty($fallback_types) && !\in_array($uri_extension, $fallback_types, true)) { | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
mahagr
Author
Member
|
||
return false; | ||
} | ||
if (!array_key_exists($uri_extension, $supported_types)) { | ||
return false; | ||
} | ||
|
||
$path_parts = pathinfo($path); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
what's the
\
for here?!\in_array