Checks for class existence in link.
$link: URL to search.
$class: Element class to search for.
bool TRUE if the class is found, FALSE otherwise.
private function hasClass($link, $class) {
return preg_match('|class="([^\\"\\s]+\\s+)*' . $class . '|', $link);
}