diff --git a/control/HTTP.php b/control/HTTP.php index 70fa20443..44cd3a009 100644 --- a/control/HTTP.php +++ b/control/HTTP.php @@ -282,7 +282,7 @@ class HTTP { $responseHeaders["Cache-Control"] = "max-age=" . self::$cache_age . ", must-revalidate, no-transform"; $responseHeaders["Pragma"] = ""; - // To do: User-Agent should only be added in situations where you *are* actually varying according to user-agent. + // To do: User-Agent should only be added in situations where you *are* actually varying according to it. $responseHeaders['Vary'] = 'Cookie, X-Forwarded-Protocol, User-Agent, Accept'; } else { @@ -293,11 +293,12 @@ class HTTP { $responseHeaders["Last-Modified"] = self::gmt_date(self::$modification_date); /* Chrome ignores Varies when redirecting back (http://code.google.com/p/chromium/issues/detail?id=79758) - which means that if you log out, you get redirected back to a page which Chrome then checks against last-modified (which passes, getting a 304) - when it shouldn't be trying to use that page at all because it's the "logged in" version. + which means that if you log out, you get redirected back to a page which Chrome then checks against + last-modified (which passes, getting a 304) when it shouldn't be trying to use that page at all because + it's the "logged in" version. - By also using and etag that includes both the modification date and all the varies values which we also check against we can catch - this and not return a 304 + By also using and etag that includes both the modification date and all the varies values which we also + check against we can catch this and not return a 304 */ $etagParts = array(self::$modification_date, serialize($_COOKIE)); if (isset($_SERVER['HTTP_X_FORWARDED_PROTOCOL'])) $etagParts[] = $_SERVER['HTTP_X_FORWARDED_PROTOCOL']; diff --git a/forms/Form.php b/forms/Form.php index 4b39d04ce..bcb796349 100644 --- a/forms/Form.php +++ b/forms/Form.php @@ -655,7 +655,9 @@ class Form extends RequestHandler { $needsCacheDisabled = false; if ($this->getSecurityToken()->isEnabled()) $needsCacheDisabled = true; if ($this->FormMethod() != 'get') $needsCacheDisabled = true; - if (!($this->validator instanceof RequiredFields) || count($this->validator->getRequired())) $needsCacheDisabled = true; + if (!($this->validator instanceof RequiredFields) || count($this->validator->getRequired())) { + $needsCacheDisabled = true; + } // If we need to disable cache, do it if ($needsCacheDisabled) HTTP::set_cache_age(0); diff --git a/forms/gridfield/GridFieldDetailForm.php b/forms/gridfield/GridFieldDetailForm.php index 267f64efc..582be93cb 100644 --- a/forms/gridfield/GridFieldDetailForm.php +++ b/forms/gridfield/GridFieldDetailForm.php @@ -369,11 +369,11 @@ class GridFieldDetailForm_ItemRequest extends RequestHandler { $form->loadDataFrom($this->record, $this->record->ID == 0 ? Form::MERGE_IGNORE_FALSEISH : Form::MERGE_DEFAULT); if($this->record->ID && !$canEdit) { - // Restrict editing of existing records - $form->makeReadonly(); + // Restrict editing of existing records + $form->makeReadonly(); } elseif(!$this->record->ID && !$canCreate) { - // Restrict creation of new records - $form->makeReadonly(); + // Restrict creation of new records + $form->makeReadonly(); } // Load many_many extraData for record. diff --git a/model/DB.php b/model/DB.php index b4eb45ac6..064e71fbc 100644 --- a/model/DB.php +++ b/model/DB.php @@ -91,7 +91,7 @@ class DB { $key = md5($key); // Ensure key is correct length for chosen cypher $ivSize = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_CFB); - $iv = mcrypt_create_iv($ivSize); + $iv = mcrypt_create_iv($ivSize); $encrypted = mcrypt_encrypt( MCRYPT_RIJNDAEL_256, $key, $name, MCRYPT_MODE_CFB, $iv ); diff --git a/model/Versioned.php b/model/Versioned.php index 6d6b618b3..9e48987c5 100644 --- a/model/Versioned.php +++ b/model/Versioned.php @@ -136,7 +136,7 @@ class Versioned extends DataExtension { * @todo Should this all go into VersionedDataQuery? */ public function augmentSQL(SQLQuery &$query, DataQuery &$dataQuery = null) { - $baseTable = ClassInfo::baseDataClass($dataQuery->dataClass()); + $baseTable = ClassInfo::baseDataClass($dataQuery->dataClass()); switch($dataQuery->getQueryParam('Versioned.mode')) { // Noop @@ -281,8 +281,8 @@ class Versioned extends DataExtension { */ function augmentLoadLazyFields(SQLQuery &$query, DataQuery &$dataQuery = null, $record) { $dataClass = $dataQuery->dataClass(); - if (isset($record['Version'])){ - $dataQuery->where("\"$dataClass\".\"RecordID\" = " . $record['ID']); + if (isset($record['Version'])){ + $dataQuery->where("\"$dataClass\".\"RecordID\" = " . $record['ID']); $dataQuery->where("\"$dataClass\".\"Version\" = " . $record['Version']); $dataQuery->setQueryParam('Versioned.mode', 'all_versions'); }