Something went wrong on our end
ISTWCMS-7266: Refactor link handling logic in UwCblLinks block.
Compare changes
- Igor Biki authored
Extracted base path validation into a reusable private method `getInternalUrlIfValid`, improving code clarity and maintainability. Simplified the handling of leading slashes for external links by updating comments and removing redundant logic.
+ 34
− 7
@@ -8,6 +8,7 @@ use Drupal\Core\Entity\EntityTypeManagerInterface;
@@ -946,12 +947,8 @@ class UwCblLinks extends BlockBase implements ContainerFactoryPluginInterface {
@@ -960,7 +957,7 @@ class UwCblLinks extends BlockBase implements ContainerFactoryPluginInterface {
@@ -1045,4 +1042,34 @@ class UwCblLinks extends BlockBase implements ContainerFactoryPluginInterface {