You are here

public function MediaUnsplashHandler::claim in Media Unsplash 7

Verify link.

Parameters

string $embedCode: URL which needs to be validated.

Return value

bool Return TRUE or FALSE.

File

includes/MediaUnsplashHandler.inc, line 83
Definition of MediaUnsplashHandler.

Class

MediaUnsplashHandler
A class for managing the addition of Internet files.

Code

public function claim($embedCode) {

  // Claim only valid URLs from unsplash.
  if (!empty($embedCode)) {
    $host = @parse_url($embedCode, PHP_URL_HOST);
    if ($host == 'unsplash.com') {
      return TRUE;
    }
  }
  return FALSE;
}