You are here

public function PurgeTarget::validate in Purge 7.2

Validate

Return value

$errors

Overrides Purge::validate

File

includes/purge.class.inc, line 290
Contains all class and interface definitions for Purge.

Class

PurgeTarget
Abstract Class definition for Purge Targets.

Code

public function validate() {
  $errors = array();

  // Validate the URLs
  foreach ($this->urls as $url) {
    if (!valid_url($url, TRUE)) {
      $url = check_plain($url);
      $errors[] = array(
        'name' => 'urls',
        'message' => t('Target URL @url in target @name is an invalid target URL.', array(
          '@url' => $url,
          '@name' => $this->name,
        )),
      );
    }
  }
  return $errors;
}