commit ecb638c60ca07b3ca19d5664d4c33d5a735f3311 Author: Jonathan AraƱa Cruz Date: Wed Nov 21 10:20:54 2012 +0100 1377948-new_changes diff --git a/editors/ace.inc b/editors/ace.inc index 10a9aad..390f296 100644 --- a/editors/ace.inc +++ b/editors/ace.inc @@ -59,9 +59,14 @@ function wysiwyg_ace_editor() { * Version callback for wysiwyg_ace_editor(). */ function wysiwyg_ace_version($editor) { - // @todo Detect this for real (perhaps from ChangeLog.txt) rather than - // hardcoding it. - return '0.2.0'; + $changelog = $editor['library path'] . '/ChangeLog.txt'; + $changelog = fopen($changelog, 'r'); + $line = fgets($changelog); + if (preg_match('@Version ([0-9\.]+)@', $line, $version)) { + fclose($changelog); + return $version[1]; + } + fclose($changelog); } /**