@@ -104,18 +104,18 @@ |
||
| 104 | 104 | { |
| 105 | 105 | $fieldName = $this->name; |
| 106 | 106 | if ($fieldName) { |
| 107 | - $url = (string) $this->value; |
|
| 108 | - if(! $url) { |
|
| 107 | + $url = (string) $this->value; |
|
| 108 | + if (!$url) { |
|
| 109 | 109 | return ''; |
| 110 | 110 | } |
| 111 | 111 | $config = Config::inst()->get(ExternalURLField::class, 'default_config'); |
| 112 | 112 | $defaults = $config['defaultparts']; |
| 113 | - if (! preg_match('#^[a-zA-Z]+://#', $url)) { |
|
| 113 | + if (!preg_match('#^[a-zA-Z]+://#', $url)) { |
|
| 114 | 114 | $url = $defaults['scheme'] . '://' . $url; |
| 115 | 115 | } |
| 116 | 116 | |
| 117 | 117 | $parts = parse_url($url); |
| 118 | - if (! $parts) { |
|
| 118 | + if (!$parts) { |
|
| 119 | 119 | //can't parse url, abort |
| 120 | 120 | return ''; |
| 121 | 121 | } |
@@ -75,7 +75,7 @@ discard block |
||
| 75 | 75 | } |
| 76 | 76 | |
| 77 | 77 | if (is_array($this->config[$name])) { |
| 78 | - if (! is_array($val)) { |
|
| 78 | + if (!is_array($val)) { |
|
| 79 | 79 | user_error("The value for {$name} must be an array"); |
| 80 | 80 | } |
| 81 | 81 | |
@@ -111,7 +111,7 @@ discard block |
||
| 111 | 111 | $parentAttributes = parent::getAttributes(); |
| 112 | 112 | $attributes = []; |
| 113 | 113 | |
| 114 | - if (! isset($parentAttributes['placeholder'])) { |
|
| 114 | + if (!isset($parentAttributes['placeholder'])) { |
|
| 115 | 115 | $attributes['placeholder'] = $this->config['defaultparts']['scheme'] . '://example.com'; //example url |
| 116 | 116 | } |
| 117 | 117 | |
@@ -154,7 +154,7 @@ discard block |
||
| 154 | 154 | { |
| 155 | 155 | $this->value = trim($this->value); |
| 156 | 156 | $regex = $this->config['validregex']; |
| 157 | - if ($this->value && $regex && ! preg_match($regex, $this->value)) { |
|
| 157 | + if ($this->value && $regex && !preg_match($regex, $this->value)) { |
|
| 158 | 158 | $validator->validationError( |
| 159 | 159 | $this->name, |
| 160 | 160 | _t('ExternalURLField.VALIDATION', 'Please enter a valid URL'), |
@@ -189,12 +189,12 @@ discard block |
||
| 189 | 189 | protected function rebuildURL($url) |
| 190 | 190 | { |
| 191 | 191 | $defaults = $this->config['defaultparts']; |
| 192 | - if (! preg_match('#^[a-zA-Z]+://#', $url)) { |
|
| 192 | + if (!preg_match('#^[a-zA-Z]+://#', $url)) { |
|
| 193 | 193 | $url = $defaults['scheme'] . '://' . $url; |
| 194 | 194 | } |
| 195 | 195 | |
| 196 | 196 | $parts = parse_url($url); |
| 197 | - if (! $parts) { |
|
| 197 | + if (!$parts) { |
|
| 198 | 198 | //can't parse url, abort |
| 199 | 199 | return ''; |
| 200 | 200 | } |