Permalink
Browse files

Corrects indentation and line length

  • Loading branch information...
1 parent 1f1b115 commit 3439e30ac17698a71488e559f4f93d957b7973b3 @simonwelsh simonwelsh committed Jan 24, 2013
Showing with 17 additions and 14 deletions.
  1. +6 −5 control/HTTP.php
  2. +3 −1 forms/Form.php
  3. +4 −4 forms/gridfield/GridFieldDetailForm.php
  4. +1 −1 model/DB.php
  5. +3 −3 model/Versioned.php
View
@@ -282,7 +282,7 @@ public static function add_cache_headers($body = null) {
$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 @@ public static function add_cache_headers($body = null) {
$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'];
View
@@ -655,7 +655,9 @@ public function getAttributesHTML($attrs = null) {
$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);
@@ -369,11 +369,11 @@ public function ItemEditForm() {
$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.
View
@@ -91,7 +91,7 @@ public static function set_alternative_database_name($name = null) {
$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
);
View
@@ -136,7 +136,7 @@ public function augmentDataQueryCreation(SQLQuery &$query, DataQuery &$dataQuery
* @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 @@ public function augmentSQL(SQLQuery &$query, DataQuery &$dataQuery = null) {
*/
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');
}

0 comments on commit 3439e30

Please sign in to comment.