diff --git a/e107_handlers/shortcode_handler.php b/e107_handlers/shortcode_handler.php index a076e9580..5a89316ad 100644 --- a/e107_handlers/shortcode_handler.php +++ b/e107_handlers/shortcode_handler.php @@ -1260,11 +1260,12 @@ class e_parse_shortcode { // Code is not registered, let's look for .sc or .php file // .php file takes precedence over .sc file - if (is_readable(e_CORE.'shortcodes/single/'.strtolower($code).'.php')) + $codeLower = strtolower($code); + if (is_readable(e_CORE.'shortcodes/single/'.$codeLower.'.php')) { - $_function = strtolower($code).'_shortcode'; - $_class = ($code === 'sitelinks_alt') ? sitelinks_alt : null; // all others are plain functions. - $_path = e_CORE.'shortcodes/single/'.strtolower($code).'.php'; + $_function = $codeLower.'_shortcode'; + $_class = ($codeLower === 'sitelinks_alt') ? 'sitelinks_alt' : null; // all others are plain functions. + $_path = e_CORE.'shortcodes/single/'.$codeLower.'.php'; include_once($_path); @@ -1289,7 +1290,7 @@ class e_parse_shortcode } else { - $scFile = e_CORE.'shortcodes/single/'.strtolower($code).'.sc'; + $scFile = e_CORE.'shortcodes/single/'.$codeLower.'.sc'; $_path = $scFile; } } diff --git a/e107_tests/tests/unit/e_parse_shortcodeTest.php b/e107_tests/tests/unit/e_parse_shortcodeTest.php index 6761ba5f2..866f36034 100644 --- a/e107_tests/tests/unit/e_parse_shortcodeTest.php +++ b/e107_tests/tests/unit/e_parse_shortcodeTest.php @@ -1688,7 +1688,8 @@ class e_parse_shortcodeTest extends \Codeception\Test\Unit 'url' => 'news/view/item|news_id=1&news_sef=sef-string&category_id=1&category_sef=category-sef&options[full]=1', 'user_extended' => 'name.text.1', 'lan' => 'LAN_EDIT', - 'search' => 'all' + 'search' => 'all', + 'sitelinks_alt' => '/e107_themes/bootstrap3/images/logo.webp+noclick', ); foreach($list as $sc) @@ -1701,7 +1702,6 @@ class e_parse_shortcodeTest extends \Codeception\Test\Unit continue; } - $shortcode = '{'; $shortcode .= strtoupper($name); $shortcode .= isset($parms[$name]) ? '='.$parms[$name] : '';