mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
Merge branch '4.1' into 4.2
This commit is contained in:
commit
37a266f2f0
@ -2,6 +2,8 @@
|
|||||||
|
|
||||||
namespace SilverStripe\Control;
|
namespace SilverStripe\Control;
|
||||||
|
|
||||||
|
use SilverStripe\Core\Environment;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* CLI specific request building logic
|
* CLI specific request building logic
|
||||||
*/
|
*/
|
||||||
@ -66,4 +68,19 @@ class CLIRequestBuilder extends HTTPRequestBuilder
|
|||||||
// Parse rest of variables as standard
|
// Parse rest of variables as standard
|
||||||
return parent::cleanEnvironment($variables);
|
return parent::cleanEnvironment($variables);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param array $variables
|
||||||
|
* @param string $input
|
||||||
|
* @return HTTPRequest
|
||||||
|
*/
|
||||||
|
public static function createFromVariables(array $variables, $input, $url = null)
|
||||||
|
{
|
||||||
|
$request = parent::createFromVariables($variables, $input, $url);
|
||||||
|
// unset scheme so that SS_BASE_URL can provide `is_https` information if required
|
||||||
|
$scheme = parse_url(Environment::getEnv('SS_BASE_URL'), PHP_URL_SCHEME);
|
||||||
|
$request->setScheme($scheme);
|
||||||
|
|
||||||
|
return $request;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -790,6 +790,9 @@ class Email extends ViewableData
|
|||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Do not interfere with emails styles
|
||||||
|
Requirements::clear();
|
||||||
|
|
||||||
// Render plain part
|
// Render plain part
|
||||||
if ($plainTemplate && !$plainPart) {
|
if ($plainTemplate && !$plainPart) {
|
||||||
$plainPart = $this->renderWith($plainTemplate, $this->getData());
|
$plainPart = $this->renderWith($plainTemplate, $this->getData());
|
||||||
@ -806,6 +809,9 @@ class Email extends ViewableData
|
|||||||
$htmlPartObject = DBField::create_field('HTMLFragment', $htmlPart);
|
$htmlPartObject = DBField::create_field('HTMLFragment', $htmlPart);
|
||||||
$plainPart = $htmlPartObject->Plain();
|
$plainPart = $htmlPartObject->Plain();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Rendering is finished
|
||||||
|
Requirements::restore();
|
||||||
|
|
||||||
// Fail if no email to send
|
// Fail if no email to send
|
||||||
if (!$plainPart && !$htmlPart) {
|
if (!$plainPart && !$htmlPart) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user