CoreCommunity ExtensionsIncubatorDistributionsTYPO3 4.5 ProjectsTYPO3 4.6 ProjectsTYPO3 4.7 ProjectsTYPO3 6.0 ProjectsTYPO3 6.1 ProjectsTYPO3 6.2 Projects (+)

Suggestion #30457

Sweet parsed links

Added by Robman over 1 year ago.

Status:New Start date:2011-09-29
Priority:Could have Due date:
Assignee:André Steiling % Done:

0%

Category:Frontend Plugin
Target version:1.2
TYPO3 Version:4.5 Has patch:No
PHP Version:5.4
Votes: 0

Description

Hi André,

I can't get the "uri-parser" out of my head ;) And maybe is this a small solution for the next rev. or version.

 1 function isURL($url) {
 2   if (! preg_match ( '#^http\\:\\/\\/[a-z0-9\-]+\.([a-z0-9\-]+\.)?[a-z]+#i', $url )) {
 3     return false;
 4   } else {
 5     return true;
 6   }
 7 }
 8 
 9 if ($this->config ['website_validation'] && ! empty ( $this->postvars ['homepage'] ) && $this->postvars ['homepage'] != 'http://') {
10   if ($this->isURL ( $this->postvars ['homepage'] ) == false) {
11     $error .= '<li>' . ucfirst ( $this->pi_getLL ( 'form_homepage' ) ) . " (" . $this->pi_getLL ( 'form_invalid_field' ) . ")</li>\n";
12     $this->errorFields ['website_validation'] = false;
13   }
14 }

Greetings,
Robman

Also available in: Atom PDF