mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
adding a space before casting into a different type
This commit is contained in:
parent
e2fbbda2fd
commit
e6084b7ad2
@ -576,7 +576,7 @@ class Controller extends RequestHandler implements TemplateGlobalProvider {
|
|||||||
$queryargs = array_merge($queryargs, $localargs);
|
$queryargs = array_merge($queryargs, $localargs);
|
||||||
}
|
}
|
||||||
if((is_string($arg) && $arg) || is_numeric($arg)) {
|
if((is_string($arg) && $arg) || is_numeric($arg)) {
|
||||||
$arg = (string)$arg;
|
$arg = (string) $arg;
|
||||||
if($result && substr($result,-1) != '/' && $arg[0] != '/') $result .= "/$arg";
|
if($result && substr($result,-1) != '/' && $arg[0] != '/') $result .= "/$arg";
|
||||||
else $result .= (substr($result, -1) == '/' && $arg[0] == '/') ? ltrim($arg, '/') : $arg;
|
else $result .= (substr($result, -1) == '/' && $arg[0] == '/') ? ltrim($arg, '/') : $arg;
|
||||||
}
|
}
|
||||||
|
@ -122,7 +122,7 @@ class Director implements TemplateGlobalProvider {
|
|||||||
: $_SERVER['REQUEST_METHOD'],
|
: $_SERVER['REQUEST_METHOD'],
|
||||||
$url,
|
$url,
|
||||||
$_GET,
|
$_GET,
|
||||||
ArrayLib::array_merge_recursive((array)$_POST, (array)$_FILES),
|
ArrayLib::array_merge_recursive((array) $_POST, (array) $_FILES),
|
||||||
@file_get_contents('php://input')
|
@file_get_contents('php://input')
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -295,9 +295,9 @@ class Director implements TemplateGlobalProvider {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Replace the superglobals with appropriate test values
|
// Replace the superglobals with appropriate test values
|
||||||
$_REQUEST = ArrayLib::array_merge_recursive((array)$getVars, (array)$postVars);
|
$_REQUEST = ArrayLib::array_merge_recursive((array) $getVars, (array) $postVars);
|
||||||
$_GET = (array)$getVars;
|
$_GET = (array) $getVars;
|
||||||
$_POST = (array)$postVars;
|
$_POST = (array) $postVars;
|
||||||
$_SESSION = $session ? $session->inst_getAll() : array();
|
$_SESSION = $session ? $session->inst_getAll() : array();
|
||||||
$_COOKIE = $cookieJar->getAll(false);
|
$_COOKIE = $cookieJar->getAll(false);
|
||||||
Injector::inst()->registerService($cookieJar, 'Cookie_Backend');
|
Injector::inst()->registerService($cookieJar, 'Cookie_Backend');
|
||||||
|
@ -109,8 +109,8 @@ class SS_HTTPRequest implements ArrayAccess {
|
|||||||
$this->httpMethod = strtoupper(self::detect_method($httpMethod, $postVars));
|
$this->httpMethod = strtoupper(self::detect_method($httpMethod, $postVars));
|
||||||
$this->setUrl($url);
|
$this->setUrl($url);
|
||||||
|
|
||||||
$this->getVars = (array)$getVars;
|
$this->getVars = (array) $getVars;
|
||||||
$this->postVars = (array)$postVars;
|
$this->postVars = (array) $postVars;
|
||||||
$this->body = $body;
|
$this->body = $body;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -160,7 +160,7 @@ class SS_HTTPResponse {
|
|||||||
* @return SS_HTTPRequest $this
|
* @return SS_HTTPRequest $this
|
||||||
*/
|
*/
|
||||||
public function setBody($body) {
|
public function setBody($body) {
|
||||||
$this->body = $body ? (string)$body : $body; // Don't type-cast false-ish values, eg null is null not ''
|
$this->body = $body ? (string) $body : $body; // Don't type-cast false-ish values, eg null is null not ''
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -87,7 +87,7 @@ class PjaxResponseNegotiator {
|
|||||||
foreach($fragments as $fragment) {
|
foreach($fragments as $fragment) {
|
||||||
if(isset($callbacks[$fragment])) {
|
if(isset($callbacks[$fragment])) {
|
||||||
$res = call_user_func($callbacks[$fragment]);
|
$res = call_user_func($callbacks[$fragment]);
|
||||||
$responseParts[$fragment] = $res ? (string)$res : $res;
|
$responseParts[$fragment] = $res ? (string) $res : $res;
|
||||||
} else {
|
} else {
|
||||||
throw new SS_HTTPResponse_Exception("X-Pjax = '$fragment' not supported for this URL.", 400);
|
throw new SS_HTTPResponse_Exception("X-Pjax = '$fragment' not supported for this URL.", 400);
|
||||||
}
|
}
|
||||||
|
@ -351,7 +351,7 @@ class RequestHandler extends ViewableData {
|
|||||||
if($action == 'index') return true;
|
if($action == 'index') return true;
|
||||||
|
|
||||||
// Don't allow access to any non-public methods (inspect instance plus all extensions)
|
// Don't allow access to any non-public methods (inspect instance plus all extensions)
|
||||||
$insts = array_merge(array($this), (array)$this->getExtensionInstances());
|
$insts = array_merge(array($this), (array) $this->getExtensionInstances());
|
||||||
foreach($insts as $inst) {
|
foreach($insts as $inst) {
|
||||||
if(!method_exists($inst, $action)) continue;
|
if(!method_exists($inst, $action)) continue;
|
||||||
$r = new ReflectionClass(get_class($inst));
|
$r = new ReflectionClass(get_class($inst));
|
||||||
@ -389,7 +389,7 @@ class RequestHandler extends ViewableData {
|
|||||||
$action = strtolower($actionOrigCasing);
|
$action = strtolower($actionOrigCasing);
|
||||||
|
|
||||||
$definingClass = null;
|
$definingClass = null;
|
||||||
$insts = array_merge(array($this), (array)$this->getExtensionInstances());
|
$insts = array_merge(array($this), (array) $this->getExtensionInstances());
|
||||||
foreach($insts as $inst) {
|
foreach($insts as $inst) {
|
||||||
if(!method_exists($inst, $action)) continue;
|
if(!method_exists($inst, $action)) continue;
|
||||||
$r = new ReflectionClass(get_class($inst));
|
$r = new ReflectionClass(get_class($inst));
|
||||||
|
@ -612,7 +612,7 @@ class Session {
|
|||||||
*/
|
*/
|
||||||
public static function set_timeout($timeout) {
|
public static function set_timeout($timeout) {
|
||||||
Deprecation::notice('4.0', 'Use the "Session.timeout" config setting instead');
|
Deprecation::notice('4.0', 'Use the "Session.timeout" config setting instead');
|
||||||
Config::inst()->update('Session', 'timeout', (int)$timeout);
|
Config::inst()->update('Session', 'timeout', (int) $timeout);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user