protected function WebformLibrariesManager::getCkeditorVersion in Webform 6.x
Same name and namespace in other branches
- 8.5 src/WebformLibrariesManager.php \Drupal\webform\WebformLibrariesManager::getCkeditorVersion()
Get Drupal core's CKEditor version number.
Return value
string Drupal core's CKEditor version number.
1 call to WebformLibrariesManager::getCkeditorVersion()
- WebformLibrariesManager::initLibraries in src/
WebformLibrariesManager.php - Initialize libraries.
File
- src/
WebformLibrariesManager.php, line 624
Class
- WebformLibrariesManager
- Webform libraries manager.
Namespace
Drupal\webformCode
protected function getCkeditorVersion() {
// Get CKEditor semantic version number from the JS file.
// @see core/core.libraries.yml
$definition = $this->libraryDiscovery
->getLibraryByName('core', 'ckeditor');
$ckeditor_version = $definition['js'][0]['version'];
// Parse CKEditor semantic version number from security patches
// (i.e. 4.8.0+2018-04-18-security-patch).
if (preg_match('/^\\d+\\.\\d+\\.\\d+/', $ckeditor_version, $match)) {
return $match[0];
}
else {
return $ckeditor_version;
}
}