@@ -49,9 +49,9 @@ discard block |
||
49 | 49 | continue; |
50 | 50 | } |
51 | 51 | |
52 | - $rules['trans.' . $locale . '.label'] = 'required'; |
|
53 | - if ($this->request->get('trans.' . $locale . '.url') != null) { |
|
54 | - $rules['trans.' . $locale . '.url'] = 'url'; |
|
52 | + $rules['trans.'.$locale.'.label'] = 'required'; |
|
53 | + if ($this->request->get('trans.'.$locale.'.url') != null) { |
|
54 | + $rules['trans.'.$locale.'.url'] = 'url'; |
|
55 | 55 | } |
56 | 56 | } |
57 | 57 | |
@@ -63,8 +63,8 @@ discard block |
||
63 | 63 | $attributes = []; |
64 | 64 | |
65 | 65 | foreach (array_keys($this->request->all('trans')) as $locale) { |
66 | - $attributes['trans.' . $locale . '.label'] = $locale . ' label'; |
|
67 | - $attributes['trans.' . $locale . '.url'] = $locale . ' link'; |
|
66 | + $attributes['trans.'.$locale.'.label'] = $locale.' label'; |
|
67 | + $attributes['trans.'.$locale.'.url'] = $locale.' link'; |
|
68 | 68 | } |
69 | 69 | |
70 | 70 | $attributes['owner_reference'] = 'Interne pagina'; |
@@ -95,10 +95,10 @@ discard block |
||
95 | 95 | |
96 | 96 | // Check if it is a relative |
97 | 97 | if ($this->isRelativeUrl($trans['url'])) { |
98 | - $data['trans'][$locale]['url'] = '/' . trim($trans['url'], '/'); |
|
99 | - } elseif(Str::startsWith($trans['url'], ['mailto:', 'tel:', 'https://', 'http://'])) { |
|
98 | + $data['trans'][$locale]['url'] = '/'.trim($trans['url'], '/'); |
|
99 | + } elseif (Str::startsWith($trans['url'], ['mailto:', 'tel:', 'https://', 'http://'])) { |
|
100 | 100 | $data['trans'][$locale]['url'] = $trans['url']; |
101 | - } else { |
|
101 | + }else { |
|
102 | 102 | $data['trans'][$locale]['url'] = Url::fromString($trans['url'])->secure()->get(); |
103 | 103 | } |
104 | 104 | |
@@ -115,6 +115,6 @@ discard block |
||
115 | 115 | // Check if passed url is not intended as a host instead of a relative path |
116 | 116 | $notIntentedAsRoot = (null == Root::fromString($url)->scheme() && false === strpos($url, '.')); |
117 | 117 | |
118 | - return ($notIntentedAsRoot && in_array($url, [$nakedUrl, '/' . $nakedUrl])); |
|
118 | + return ($notIntentedAsRoot && in_array($url, [$nakedUrl, '/'.$nakedUrl])); |
|
119 | 119 | } |
120 | 120 | } |