diff --git a/application/utils.inc.php b/application/utils.inc.php index 3afd936ed..439b565f3 100644 --- a/application/utils.inc.php +++ b/application/utils.inc.php @@ -2745,12 +2745,18 @@ HTML; $bSkipped = true; } else { - foreach ($aExcludedPath as $sExcludedPath) { - // Note: We use '#' as delimiters as usual '/' is often used in paths. - if ($sExcludedPath !== '' && preg_match('#'.$sExcludedPath.'#', $sPHPFile) === 1) { - $bSkipped = true; - break; + $sPHPFile = self::LocalPath($sPHPFile); + if ($sPHPFile !== false) { + $sPHPFile = '/'.$sPHPFile; // for regex + foreach ($aExcludedPath as $sExcludedPath) { + // Note: We use '#' as delimiters as usual '/' is often used in paths. + if ($sExcludedPath !== '' && preg_match('#'.$sExcludedPath.'#', $sPHPFile) === 1) { + $bSkipped = true; + break; + } } + } else { + $bSkipped = true; // file not found } } @@ -2788,7 +2794,7 @@ HTML; $aResultPref = []; $aShortcutPrefs = appUserPreferences::GetPref('keyboard_shortcuts', []); // Note: Mind the 4 blackslashes, see utils::GetClassesForInterface() - $aShortcutClasses = utils::GetClassesForInterface('iKeyboardShortcut', '', array('[\\\\/]lib[\\\\/]', '[\\\\/]node_modules[\\\\/]', '[\\\\/]test[\\\\/]')); + $aShortcutClasses = utils::GetClassesForInterface('iKeyboardShortcut', '', array('[\\\\/]lib[\\\\/]', '[\\\\/]node_modules[\\\\/]', '[\\\\/]test[\\\\/]', '[\\\\/]tests[\\\\/]')); foreach ($aShortcutClasses as $cShortcutPlugin) { $sTriggeredElement = $cShortcutPlugin::GetShortcutTriggeredElementSelector(); diff --git a/pages/preferences.php b/pages/preferences.php index b21b8fac1..adf2929c3 100644 --- a/pages/preferences.php +++ b/pages/preferences.php @@ -774,7 +774,7 @@ try { break; case 'apply_keyboard_shortcuts': // Note: Mind the 4 blackslashes, see utils::GetClassesForInterface() - $aShortcutClasses = utils::GetClassesForInterface('iKeyboardShortcut', '', array('[\\\\/]lib[\\\\/]', '[\\\\/]node_modules[\\\\/]', '[\\\\/]test[\\\\/]')); + $aShortcutClasses = utils::GetClassesForInterface('iKeyboardShortcut', '', array('[\\\\/]lib[\\\\/]', '[\\\\/]node_modules[\\\\/]', '[\\\\/]test[\\\\/]', '[\\\\/]tests[\\\\/]')); $aShortcutPrefs = []; foreach ($aShortcutClasses as $cShortcutPlugin) { foreach ($cShortcutPlugin::GetShortcutKeys() as $aShortcutKey) { diff --git a/sources/application/TwigBase/UI/UIBlockExtension.php b/sources/application/TwigBase/UI/UIBlockExtension.php index 9af1c1d4d..3a81a647b 100644 --- a/sources/application/TwigBase/UI/UIBlockExtension.php +++ b/sources/application/TwigBase/UI/UIBlockExtension.php @@ -8,9 +8,7 @@ namespace Combodo\iTop\Application\TwigBase\UI; -use Exception; -use ReflectionClass; -use SetupUtils; +use Combodo\iTop\Application\UI\Base\iUIBlockFactory; use Twig\Extension\AbstractExtension; use utils; @@ -30,7 +28,7 @@ class UIBlockExtension extends AbstractExtension { $aParsers = []; - $sInterface = "Combodo\\iTop\\Application\\UI\\Base\\iUIBlockFactory"; + $sInterface = iUIBlockFactory::class; $aFactoryClasses = utils::GetClassesForInterface($sInterface, 'UIBlockFactory'); foreach ($aFactoryClasses as $sFactoryClass) {