diff --git a/admin/_config.php b/admin/_config.php index 7b52790c7..9f698c5a8 100644 --- a/admin/_config.php +++ b/admin/_config.php @@ -26,8 +26,7 @@ HtmlEditorConfig::get('cms')->setOptions(array( . "dd[id|class|title|dir],dl[id|class|title|dir],dt[id|class|title|dir],@[id,style,class]", 'extended_valid_elements' => "img[class|src|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name" . "|usemap|data*],iframe[src|name|width|height|align|frameborder|marginwidth|marginheight|scrolling]," - . "object[width|height|data|type],param[name|value],map[class|name|id],area[shape|coords|href|target|alt]", - 'spellchecker_rpc_url' => THIRDPARTY_DIR . '/tinymce-spellchecker/rpc.php' + . "object[width|height|data|type],param[name|value],map[class|name|id],area[shape|coords|href|target|alt]" )); HtmlEditorConfig::get('cms')->enablePlugins('media', 'fullscreen', 'inlinepopups'); diff --git a/dev/install/install.php5 b/dev/install/install.php5 index b7b2aa744..c36ee2b31 100644 --- a/dev/install/install.php5 +++ b/dev/install/install.php5 @@ -18,8 +18,11 @@ ini_set('mysql.connect_timeout', 5); // Don't die half was through installation; that does more harm than good ini_set('max_execution_time', 0); -// Prevent a white-screen-of-death -ini_set('display_errors', 'on'); + +// set display_errors php setting to on to force installer to avoid blank screen of death. +// get the original value so it can be used in PHP requirement checks later in this script. +$originalDisplayErrorsValue = ini_get('display_errors'); +ini_set('display_errors', '1'); error_reporting(E_ALL | E_STRICT); @@ -46,31 +49,31 @@ if ($dirsToCheck[0] == $dirsToCheck[1]) { unset($dirsToCheck[1]); } foreach ($dirsToCheck as $dir) { - //check this dir and every parent dir (until we hit the base of the drive) +//check this dir and every parent dir (until we hit the base of the drive) // or until we hit a dir we can't read - do { +do { //add the trailing slash we need to concatenate properly $dir .= DIRECTORY_SEPARATOR; //if it's readable, go ahead if (@is_readable($dir)) { - //if the file exists, then we include it, set relevant vars and break out - if (file_exists($dir . $envFile)) { - include_once($dir . $envFile); - $envFileExists = true; - //legacy variable assignment - $usingEnv = true; + //if the file exists, then we include it, set relevant vars and break out + if (file_exists($dir . $envFile)) { + include_once($dir . $envFile); + $envFileExists = true; + //legacy variable assignment + $usingEnv = true; //break out of BOTH loops because we found the $envFile break(2); } } else { //break out of the while loop, we can't read the dir - break; - } + break; + } //go up a directory $dir = dirname($dir); //here we need to check that the path of the last dir and the next one are - // not the same, if they are, we have hit the root of the drive +// not the same, if they are, we have hit the root of the drive } while (dirname($dir) != $dir); } @@ -502,7 +505,14 @@ class InstallRequirements { function suggestPHPSetting($settingName, $settingValues, $testDetails) { $this->testing($testDetails); - $val = ini_get($settingName); + // special case for display_errors, check the original value before + // it was changed at the start of this script. + if($settingName = 'display_errors') { + $val = $originalDisplayErrorsValue; + } else { + $val = ini_get($settingName); + } + if(!in_array($val, $settingValues) && $val != $settingValues) { $testDetails[2] = "$settingName is set to '$val' in php.ini. $testDetails[2]"; $this->warning($testDetails); @@ -986,7 +996,7 @@ class InstallRequirements { foreach($varNames as $varName) { if(!isset($_SERVER[$varName]) || !$_SERVER[$varName]) { $missing[] = '$_SERVER[' . $varName . ']'; - } + } } if(!$missing) { diff --git a/docs/en/changelogs/3.0.6.md b/docs/en/changelogs/3.0.6.md index 90d370f6a..26b05ef28 100644 --- a/docs/en/changelogs/3.0.6.md +++ b/docs/en/changelogs/3.0.6.md @@ -4,6 +4,7 @@ * Security: Require ADMIN for `?flush=1` (stop denial of service attacks) ([#1692](https://github.com/silverstripe/silverstripe-framework/issues/1692)) + * API: Disable discontinued Google Spellcheck in TinyMCE. Replaced by browser-based spellchecking if available (Chrome, Firefox) ## Details diff --git a/docs/en/changelogs/3.0.8.md b/docs/en/changelogs/3.0.8.md new file mode 100644 index 000000000..e4bf169d5 --- /dev/null +++ b/docs/en/changelogs/3.0.8.md @@ -0,0 +1,11 @@ +# 3.0.8 + +### API Changes + + * 2013-08-03 [0e7231f](https://github.com/silverstripe/sapphire/commit/0e7231f) Disable discontinued Google Spellcheck in TinyMCE (Ingo Schommer) + +### Bugfixes + + * 2013-10-04 [dd49834](https://github.com/silverstripe/sapphire/commit/dd49834) Fixing installer not checking display_errors correctly. (Sean Harvey) + * 2013-10-03 [f67b549](https://github.com/silverstripe/sapphire/commit/f67b549) Fixed cross-platform issues with test cases and file utilities (Damian Mooyman) + * 2013-10-01 [daf92e6](https://github.com/silverstripe/silverstripe-cms/commit/daf92e6) ReportAdmin report links regression (Ingo Schommer) diff --git a/docs/en/index.md b/docs/en/index.md index 0ab92963b..d3dda88ef 100644 --- a/docs/en/index.md +++ b/docs/en/index.md @@ -55,8 +55,4 @@ Please read our [guide to contributing documentation](misc/contributing/document ### Level 4: Contributing to the SilverStripe core * [Contributing](misc/contributing) -* [Coding Conventions](misc/coding-conventions) - -
-Looking for the old DokuWiki installation? See [doc.silverstripe.org/old](http://doc.silverstripe.org/old). -
+* [Coding Conventions](misc/coding-conventions) \ No newline at end of file diff --git a/docs/en/topics/rich-text-editing.md b/docs/en/topics/rich-text-editing.md index 2a9301e14..d2122555d 100644 --- a/docs/en/topics/rich-text-editing.md +++ b/docs/en/topics/rich-text-editing.md @@ -277,6 +277,29 @@ on your own editor wrapper. Note that the `[api:HtmlEditorConfig]` is currently so its up to you to either convert existing configuration as applicable, or start your own configuration. +### Integrating a Spellchecker for TinyMCE + +The TinyMCE editor uses spellchecking integrated into the browser if possible +([docs](http://www.tinymce.com/wiki.php/Plugin3x:spellchecker)). +Most modern browsers support it, although Internet Explorer only has limited +support in IE10. Alternatively, you can use the PSpell PHP module for server side checks. +Assuming you have the module installed, here's how you enable its use in `mysite/_config.php`: + + :::php + HtmlEditorConfig::get('cms')->enablePlugins('spellchecker'); + HtmlEditorConfig::get('cms')->addButtonsToLine(2, 'spellchecker'); + HtmlEditorConfig::get('cms')->setOption( + 'spellchecker_rpc_url', + THIRDPARTY_DIR . '/tinymce-spellchecker/rpc.php' + ); + HtmlEditorConfig::get('cms')->setOption('browser_spellcheck', false); + +Now change the default spellchecker in `framework/thirdparty/tinymce-spellchecker/config.php`: + + :::php + // ... + $config['general.engine'] = 'PSpell'; + ## Related * [Howto: Extend the CMS Interface](../howto/extend-cms-interface) diff --git a/forms/HtmlEditorConfig.php b/forms/HtmlEditorConfig.php index aef07d589..e9a46704c 100644 --- a/forms/HtmlEditorConfig.php +++ b/forms/HtmlEditorConfig.php @@ -86,6 +86,7 @@ class HtmlEditorConfig { 'safari_warning' => false, 'relative_urls' => true, 'verify_html' => true, + 'browser_spellcheck' => true, ); /** @@ -96,7 +97,6 @@ class HtmlEditorConfig { 'table' => null, 'emotions' => null, 'paste' => null, - 'spellchecker' => null ); /** @@ -106,7 +106,7 @@ class HtmlEditorConfig { 1 => array('bold','italic','underline','strikethrough','separator', 'justifyleft','justifycenter','justifyright','justifyfull','formatselect','separator', 'bullist','numlist','outdent','indent','blockquote','hr','charmap'), - 2 => array('undo','redo','separator','cut','copy','paste','pastetext','pasteword','spellchecker','separator', + 2 => array('undo','redo','separator','cut','copy','paste','pastetext','pasteword','separator', 'advcode','search','replace','selectall','visualaid','separator','tablecontrols'), 3 => array() ); diff --git a/model/Versioned.php b/model/Versioned.php index b2e2de3a0..2d30dae5b 100644 --- a/model/Versioned.php +++ b/model/Versioned.php @@ -941,7 +941,7 @@ class Versioned extends DataExtension { Session::set('readingMode', 'Stage.' . $stage); } - if(isset($_GET['archiveDate'])) { + if(isset($_GET['archiveDate']) && strtotime($_GET['archiveDate'])) { Session::set('readingMode', 'Archive.' . $_GET['archiveDate']); } diff --git a/tests/core/CoreTest.php b/tests/core/CoreTest.php index 9d312ca30..a6e6df99c 100644 --- a/tests/core/CoreTest.php +++ b/tests/core/CoreTest.php @@ -52,8 +52,8 @@ class CoreTest extends SapphireTest { if(file_exists($path)) { rmdir($path . DIRECTORY_SEPARATOR . $user); rmdir($path); - } } - } + } + } }