public function AutoLoginUrlConvertTextClass::replace in Auto Login URL 7
Replace each link in the text.
Parameters
array $matches: Matches array.
Return value
string Converted URL.
File
- ./
auto_login_url.module, line 483 - Main file for auto_login_url module.
Class
- AutoLoginUrlConvertTextClass
- Class to use for callback of link replacement.
Code
public function replace(array $matches) {
// Make a new search to check that the link is not image.
// I know, not very clean.
$pattern = '/(\\.jpg|\\.gif|\\.png)/';
preg_match($pattern, $matches[0], $new_matches);
if (count($new_matches) > 0) {
return $matches[0];
}
else {
return auto_login_url_create($this->uid, $matches[0], TRUE);
}
}