mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Merge pull request #4657 from spekulatius/adding-space-before-casting
adding a space before casting into a different type
This commit is contained in:
commit
c724d551a1
@ -576,7 +576,7 @@ class Controller extends RequestHandler implements TemplateGlobalProvider {
|
||||
$queryargs = array_merge($queryargs, $localargs);
|
||||
}
|
||||
if((is_string($arg) && $arg) || is_numeric($arg)) {
|
||||
$arg = (string)$arg;
|
||||
$arg = (string) $arg;
|
||||
if($result && substr($result,-1) != '/' && $arg[0] != '/') $result .= "/$arg";
|
||||
else $result .= (substr($result, -1) == '/' && $arg[0] == '/') ? ltrim($arg, '/') : $arg;
|
||||
}
|
||||
|
@ -137,7 +137,7 @@ class Director implements TemplateGlobalProvider {
|
||||
: $_SERVER['REQUEST_METHOD'],
|
||||
$url,
|
||||
$_GET,
|
||||
ArrayLib::array_merge_recursive((array)$_POST, (array)$_FILES),
|
||||
ArrayLib::array_merge_recursive((array) $_POST, (array) $_FILES),
|
||||
@file_get_contents('php://input')
|
||||
);
|
||||
|
||||
@ -310,9 +310,9 @@ class Director implements TemplateGlobalProvider {
|
||||
}
|
||||
|
||||
// Replace the superglobals with appropriate test values
|
||||
$_REQUEST = ArrayLib::array_merge_recursive((array)$getVars, (array)$postVars);
|
||||
$_GET = (array)$getVars;
|
||||
$_POST = (array)$postVars;
|
||||
$_REQUEST = ArrayLib::array_merge_recursive((array) $getVars, (array) $postVars);
|
||||
$_GET = (array) $getVars;
|
||||
$_POST = (array) $postVars;
|
||||
$_SESSION = $session ? $session->inst_getAll() : array();
|
||||
$_COOKIE = $cookieJar->getAll(false);
|
||||
Injector::inst()->registerService($cookieJar, 'Cookie_Backend');
|
||||
|
@ -160,7 +160,7 @@ class SS_HTTPResponse {
|
||||
* @return SS_HTTPRequest $this
|
||||
*/
|
||||
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;
|
||||
}
|
||||
|
||||
|
@ -87,7 +87,7 @@ class PjaxResponseNegotiator {
|
||||
foreach($fragments as $fragment) {
|
||||
if(isset($callbacks[$fragment])) {
|
||||
$res = call_user_func($callbacks[$fragment]);
|
||||
$responseParts[$fragment] = $res ? (string)$res : $res;
|
||||
$responseParts[$fragment] = $res ? (string) $res : $res;
|
||||
} else {
|
||||
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;
|
||||
|
||||
// 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) {
|
||||
if(!method_exists($inst, $action)) continue;
|
||||
$r = new ReflectionClass(get_class($inst));
|
||||
@ -389,7 +389,7 @@ class RequestHandler extends ViewableData {
|
||||
$action = strtolower($actionOrigCasing);
|
||||
|
||||
$definingClass = null;
|
||||
$insts = array_merge(array($this), (array)$this->getExtensionInstances());
|
||||
$insts = array_merge(array($this), (array) $this->getExtensionInstances());
|
||||
foreach($insts as $inst) {
|
||||
if(!method_exists($inst, $action)) continue;
|
||||
$r = new ReflectionClass(get_class($inst));
|
||||
|
Loading…
Reference in New Issue
Block a user