| Conditions | 3 |
| Paths | 2 |
| Total Lines | 16 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 13 | public function validate() : bool |
||
| 14 | { |
||
| 15 | // every link needs a host. This case can happen for ex, if |
||
| 16 | // the link starts with a typo with only one slash, like: |
||
| 17 | // "http:/hostname" |
||
| 18 | if($this->hasHost() || $this->isSchemeLess()) { |
||
| 19 | return true; |
||
| 20 | } |
||
| 21 | |||
| 22 | $this->parser->setError( |
||
| 23 | URLInfo::ERROR_MISSING_HOST, |
||
| 24 | t('Cannot determine the link\'s host name.') . ' ' . |
||
| 25 | t('This usually happens when there\'s a typo somewhere.') |
||
| 26 | ); |
||
| 27 | |||
| 28 | return false; |
||
| 29 | } |
||
| 31 |