Skip to content

Commit adca82f

Browse files
committed
Update MFormOutputHelper.php
1 parent 6c28f91 commit adca82f

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

lib/MForm/Utils/MFormOutputHelper.php

+8-2
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,15 @@ public static function getCustomUrl(mixed $value = null, ?string $lang = null):
103103
// Determine the language to use (current language if none provided)
104104
$lang = $lang ?? rex_clang::getCurrentId();
105105

106+
// Check if the value is a REDAXO article (starts with redaxo://)
107+
if (is_string($value) && str_starts_with($value, 'redaxo://')) {
108+
$articleId = (int) substr($value, 9); // Remove 'redaxo://' and convert the rest to an integer
109+
return rex_getUrl($articleId, $lang);
110+
}
111+
106112
// Check if the value is a REDAXO article (starts with rex://)
107-
if (is_string($value) && str_starts_with($value, 'rexaxo://')) {
108-
$articleId = (int) substr($value, 9); // Remove 'rex://' and convert the rest to an integer
113+
if (is_string($value) && str_starts_with($value, 'rex://')) {
114+
$articleId = (int) substr($value, 6); // Remove 'redaxo://' and convert the rest to an integer
109115
return rex_getUrl($articleId, $lang);
110116
}
111117

0 commit comments

Comments
 (0)