mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Merge branch '3.5' into 3.6
This commit is contained in:
commit
ecc88b2cbe
@ -92,7 +92,10 @@
|
|||||||
fields.not(':radio,:checkbox').bind('change.changetracker', onchange);
|
fields.not(':radio,:checkbox').bind('change.changetracker', onchange);
|
||||||
fields.each(function() {
|
fields.each(function() {
|
||||||
if($(this).is(':radio,:checkbox')) {
|
if($(this).is(':radio,:checkbox')) {
|
||||||
origVal = self.find(':input[name=' + $(this).attr('name') + ']:checked').val();
|
origVal = self.find(':input[name="' + $(this).attr('name') + '"]:checked').val();
|
||||||
|
if("undefined" === typeof origVal){
|
||||||
|
origVal = 0;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
origVal = $(this).val();
|
origVal = $(this).val();
|
||||||
}
|
}
|
||||||
|
@ -396,7 +396,7 @@ class Upload_Validator {
|
|||||||
if (empty($this->allowedMaxFileSize)) {
|
if (empty($this->allowedMaxFileSize)) {
|
||||||
// Set default max file sizes if there isn't
|
// Set default max file sizes if there isn't
|
||||||
$fileSize = Config::inst()->get('Upload_Validator', 'default_max_file_size');
|
$fileSize = Config::inst()->get('Upload_Validator', 'default_max_file_size');
|
||||||
if (isset($fileSize)) {
|
if (!empty($fileSize)) {
|
||||||
$this->setAllowedMaxFileSize($fileSize);
|
$this->setAllowedMaxFileSize($fileSize);
|
||||||
} else {
|
} else {
|
||||||
// When no default is present, use maximum set by PHP
|
// When no default is present, use maximum set by PHP
|
||||||
|
@ -47,11 +47,11 @@ class MemberAuthenticator extends Authenticator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Check default login (see Security::setDefaultAdmin())
|
// Check default login (see Security::setDefaultAdmin())
|
||||||
$asDefaultAdmin = $email === Security::default_admin_username();
|
$asDefaultAdmin = Security::has_default_admin() && $email === Security::default_admin_username();
|
||||||
if($asDefaultAdmin) {
|
if($asDefaultAdmin) {
|
||||||
// If logging is as default admin, ensure record is setup correctly
|
// If logging is as default admin, ensure record is setup correctly
|
||||||
$member = Member::default_admin();
|
$member = Member::default_admin();
|
||||||
$success = !$member->isLockedOut() && Security::check_default_admin($email, $data['Password']);
|
$success = Security::check_default_admin($email, $data['Password']) && $member && !$member->isLockedOut();
|
||||||
//protect against failed login
|
//protect against failed login
|
||||||
if($success) {
|
if($success) {
|
||||||
return $member;
|
return $member;
|
||||||
|
@ -886,9 +886,9 @@ class Security extends Controller implements TemplateGlobalProvider {
|
|||||||
*/
|
*/
|
||||||
public static function check_default_admin($username, $password) {
|
public static function check_default_admin($username, $password) {
|
||||||
return (
|
return (
|
||||||
self::$default_username === $username
|
self::has_default_admin()
|
||||||
|
&& self::$default_username === $username
|
||||||
&& self::$default_password === $password
|
&& self::$default_password === $password
|
||||||
&& self::has_default_admin()
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -134,6 +134,12 @@ class UploadTest extends SapphireTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function testGetAllowedMaxFileSize() {
|
public function testGetAllowedMaxFileSize() {
|
||||||
|
// Check the max file size defaults to PHP settings
|
||||||
|
$maxPhpSize = min(File::ini2bytes(ini_get('upload_max_filesize')), File::ini2bytes(ini_get('post_max_size')));
|
||||||
|
$v = new UploadTest_Validator();
|
||||||
|
$retrievedSize = $v->getAllowedMaxFileSize('[image]');
|
||||||
|
$this->assertEquals($maxPhpSize, $retrievedSize, 'Max file size did not default to PHP value');
|
||||||
|
|
||||||
// Check the max file size uses the config values
|
// Check the max file size uses the config values
|
||||||
$configMaxFileSizes = array(
|
$configMaxFileSizes = array(
|
||||||
'[image]' => '1k',
|
'[image]' => '1k',
|
||||||
|
2
thirdparty/tinymce/tiny_mce.js
vendored
2
thirdparty/tinymce/tiny_mce.js
vendored
File diff suppressed because one or more lines are too long
6
thirdparty/tinymce/tiny_mce_gzip.php
vendored
6
thirdparty/tinymce/tiny_mce_gzip.php
vendored
@ -16,10 +16,14 @@ require_once $frameworkPath . '/core/Constants.php';
|
|||||||
|
|
||||||
// Handle incoming request if it's a script call
|
// Handle incoming request if it's a script call
|
||||||
if (TinyMCE_Compressor::getParam("js")) {
|
if (TinyMCE_Compressor::getParam("js")) {
|
||||||
|
$tempFolder = TEMP_FOLDER . '/tinymce-cache';
|
||||||
|
if (!file_exists($tempFolder)) {
|
||||||
|
mkdir($tempFolder);
|
||||||
|
}
|
||||||
// Default settings
|
// Default settings
|
||||||
$tinyMCECompressor = new TinyMCE_Compressor(array(
|
$tinyMCECompressor = new TinyMCE_Compressor(array(
|
||||||
// CUSTOM SilverStripe
|
// CUSTOM SilverStripe
|
||||||
'cache_dir' => TEMP_FOLDER
|
'cache_dir' => $tempFolder
|
||||||
// CUSTOM END
|
// CUSTOM END
|
||||||
));
|
));
|
||||||
|
|
||||||
|
4
thirdparty/tinymce/tiny_mce_src.js
vendored
4
thirdparty/tinymce/tiny_mce_src.js
vendored
@ -1317,7 +1317,11 @@ tinymce.util.Quirks = function(editor) {
|
|||||||
// WebKit can't even do simple things like selecting an image
|
// WebKit can't even do simple things like selecting an image
|
||||||
// Needs tobe the setBaseAndExtend or it will fail to select floated images
|
// Needs tobe the setBaseAndExtend or it will fail to select floated images
|
||||||
if (/^(IMG|HR)$/.test(e.nodeName)) {
|
if (/^(IMG|HR)$/.test(e.nodeName)) {
|
||||||
|
try {
|
||||||
selection.getSel().setBaseAndExtent(e, 0, e, 1);
|
selection.getSel().setBaseAndExtent(e, 0, e, 1);
|
||||||
|
} catch (error) {
|
||||||
|
selection.select(e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (e.nodeName == 'A' && dom.hasClass(e, 'mceItemAnchor')) {
|
if (e.nodeName == 'A' && dom.hasClass(e, 'mceItemAnchor')) {
|
||||||
|
Loading…
Reference in New Issue
Block a user