You are here

function _fckeditor_requirements_getavailableversion in FCKeditor - WYSIWYG HTML editor 6.2

Fetches the version of the latest version of FCKeditor available

It tries to locate the latest version of FCKeditor in the source of http://fckeditor.net/. It might fail when the connection fails.

This function is used by fckeditor_requirements()

Parameters

$error string This string will be filled with the error reason or be untouched if no error occured:

Return value

string Version number (eg. 2.6.2) of the latest version of FCKeditor. Null if an error occured

File

./fckeditor.install, line 376

Code

function _fckeditor_requirements_getavailableversion(&$error) {
  $fckpage = drupal_http_request('http://www.fckeditor.net');
  $matches = array();
  if (!isset($fckpage->error) && preg_match('#class="release_number">\\s*([\\d\\.]+[ \\w]*)<#', $fckpage->data, $matches)) {
    return $matches[1];
  }
  else {
    $error = $fckpage->error;
  }
  return NULL;
}