diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 00000000..94e2b12a --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,9 @@ +# Pull request guidelines + +[GitHub pull requests](https://help.github.com/articles/using-pull-requests) are a great way for everyone in the community to contribute to the Laravel codebase. Found a bug? Just fix it in your fork and submit a pull request. This will then be reviewed, and, if found as good, merged into the main repository. + +In order to keep the codebase clean, stable and at high quality, even with so many people contributing, some guidelines are necessary for high-quality pull requests: + +- **Branch:** Unless they are immediate documentation fixes relevant for old versions, pull requests should be sent to the `develop` branch only. Make sure to select that branch as target when creating the pull request (GitHub will not automatically select it.) +- **Documentation:** If you are adding a new feature or changing the API in any relevant way, this should be documented. The documentation files can be found directly in the core repository. +- **Unit tests:** To keep old bugs from re-appearing and generally hold quality at a high level, the Laravel core is thoroughly unit-tested. Thus, when you create a pull request, it is expected that you unit test any new code you add. For any bug you fix, you should also add regression tests to make sure the bug will never appear again. If you are unsure about how to write tests, the core team or other contributors will gladly help. \ No newline at end of file diff --git a/application/config/strings.php b/application/config/strings.php index 3d8b68f6..bbbe230c 100644 --- a/application/config/strings.php +++ b/application/config/strings.php @@ -96,6 +96,8 @@ return array( 'sheep', 'species', 'moose', + 'chassis', + 'traffic', ), /* @@ -185,4 +187,4 @@ return array( ), -); \ No newline at end of file +); diff --git a/application/language/bg/validation.php b/application/language/bg/validation.php index fe01d9be..c95b1ed3 100644 --- a/application/language/bg/validation.php +++ b/application/language/bg/validation.php @@ -24,7 +24,7 @@ return array( "alpha" => "Полето :attribute трябва да съдържа само букви.", "alpha_dash" => "Полето :attribute трябва да съдържа само букви, цифри, долна черта и тире.", "alpha_num" => "Полето :attribute трябва да съдържа само букви и цифри.", - "array" => "The :attribute must have selected elements.", + "array" => "Полето :attribute трябва да има избрани елементи.", "before" => "Полето :attribute трябва да бъде дата преди :date.", "between" => array( "numeric" => "Полето :attribute трябва да бъде между :min и :max.", @@ -32,10 +32,10 @@ return array( "string" => "Полето :attribute трябва да бъде между :min и :max знака.", ), "confirmed" => "Полето :attribute не е потвърдено.", - "count" => "The :attribute must have exactly :count selected elements.", - "countbetween" => "The :attribute must have between :min and :max selected elements.", - "countmax" => "The :attribute must have less than :max selected elements.", - "countmin" => "The :attribute must have at least :min selected elements.", + "count" => "Полето :attribute трябва да има точно :count избрани елементи.", + "countbetween" => "Полето :attribute трябва да има от :min до :max избрани елементи.", + "countmax" => "Полето :attribute трябва да има по-малко от :max избрани елементи.", + "countmin" => "Полето :attribute трябва да има минимум :min избрани елементи.", "different" => "Полетата :attribute и :other трябва да са различни.", "email" => "Полето :attribute е с невалиден формат.", "exists" => "Избраната стойност на :attribute вече съществува.", diff --git a/application/language/de/validation.php b/application/language/de/validation.php index 170cc261..cb41d00c 100644 --- a/application/language/de/validation.php +++ b/application/language/de/validation.php @@ -22,8 +22,8 @@ return array( "active_url" => ":attribute ist keine gültige URL.", "after" => ":attribute muss ein Datum nach dem :date sein.", "alpha" => ":attribute darf nur Buchstaben beinhalten.", - "alpha_dash" => ":attribute sollte nur aus Buchstaben, Nummern und Bindestrichen bestehen.", - "alpha_num" => ":attribute sollte nur aus Buchstaben und Nummern bestehen.", + "alpha_dash" => ":attribute darf nur aus Buchstaben, Nummern und Bindestrichen bestehen.", + "alpha_num" => ":attribute darf nur aus Buchstaben und Nummern bestehen.", "array" => ":attribute muss ausgewählte Elemente haben.", "before" => ":attribute muss ein Datum vor dem :date sein.", "between" => array( @@ -57,7 +57,7 @@ return array( ), "not_in" => "Der gewählte Wert für :attribute ist ungültig.", "numeric" => ":attribute muss eine Zahl sein.", - "required" => ":attribute muss aufgefüllt sein.", + "required" => ":attribute muss ausgefüllt sein.", "same" => ":attribute und :other müssen übereinstimmen.", "size" => array( "numeric" => ":attribute muss gleich :size sein.", diff --git a/application/language/el/pagination.php b/application/language/el/pagination.php new file mode 100644 index 00000000..1b0a53ae --- /dev/null +++ b/application/language/el/pagination.php @@ -0,0 +1,19 @@ + '« Προηγούμενο', + 'next' => 'Επόμενο »', + +); \ No newline at end of file diff --git a/application/language/el/validation.php b/application/language/el/validation.php new file mode 100644 index 00000000..f461ac0e --- /dev/null +++ b/application/language/el/validation.php @@ -0,0 +1,104 @@ + "Το πεδίο :attribute πρέπει να εγκριθεί.", + "active_url" => "Το πεδίο :attribute δεν ειναι σωστό URL.", + "after" => "Το πεδίο :attribute πρέπει η ημερομηνία να ειναι μετά :date.", + "alpha" => "Το πεδίο :attribute μπορεί να περιλαμβάνει μόνο γράμματα.", + "alpha_dash" => "Το πεδίο :attribute μπορεί να περιλαμβάνει μόνο γράμματα, αριθμούς και παύλες.", + "alpha_num" => "Το πεδίο :attribute μπορεί να περιλαμβάνει μόνο γράμματα και αριθμούς.", + "array" => "Το πεδίο :attribute πρέπει να περιλαμβάνει επιλεγμένα αντικείμενα.", + "before" => "Το πεδίο :attribute πρέπει η ημερομηνία να ειναι πριν από :date.", + "between" => array( + "numeric" => "Το πεδίο :attribute πρέπει να έχει τιμές μεταξύ :min - :max.", + "file" => "Το πεδίο :attribute πρέπει να ειναι ανάμεσα σε :min - :max kb.", + "string" => "Το πεδίο :attribute πρέπει να περιλαμβάνει :min - :max χαρακτήρες.", + ), + "confirmed" => "Το πεδίο :attribute δεν πέρασε τον έλεγχο.", + "count" => "Το πεδίο :attribute πρέπει να έχει ακριβώς :count επιλεγμένα αντικείμενα.", + "countbetween" => "Το πεδίο :attribute πρέπει να είναι ανάμεσα σε :min και :max επιλεγμένα αντικείμενα.", + "countmax" => "Το πεδίο :attribute πρέπει να έχει λιγότερα από :max επιλεγμένα αντικείμενα.", + "countmin" => "Το πεδίο :attribute πρέπει να έχει τουλάχιστον :min επιλεγμένα αντικείμενα.", + "different" => "Τα πεδία :attribute και :other πρέπει να ειναι διαφορετικά.", + "email" => "Στο πεδίο :attribute η μορφοποίηση ειναι άκυρη.", + "exists" => "Το επιλεγμένο πεδίο :attribute είναι άκυρο.", + "image" => "Το πεδίο :attribute πρέπει να είναι εικόνα.", + "in" => "Το επιλεγμένο πεδίο :attribute είναι άκυρο.", + "integer" => "Το πεδίο :attribute πρέπει να ειναι αριθμός.", + "ip" => "Το πεδίο :attribute πρέπει να ειναι μια έγκυρη διεύθυνση IP.", + "match" => "Το φορμάτ του πεδίου :attribute είναι άκυρο.", + "max" => array( + "numeric" => "Το πεδίο :attribute πρέπει να είναι μικρότερο από :max.", + "file" => "Το πεδίο :attribute πρέπει να είναι μικρότερο από :max kb.", + "string" => "Το πεδίο :attribute πρέπει να έχει λιγότερους από :max χαρακτήρες.", + ), + "mimes" => "Το πεδίο :attribute πρέπει να ειναι αρχείο με τύπο: :values.", + "min" => array( + "numeric" => "Το πεδίο :attribute πρέπει να είναι τουλάχιστον :min.", + "file" => "Το πεδίο :attribute πρέπει να είναι μικρότερο από :max kb.", + "string" => "Το πεδίο :attribute πρέπει να έχει λιγότερους από :max χαρακτήρες.", + ), + "not_in" => "Το επιλεγμένο πεδίο :attribute είναι άκυρο.", + "numeric" => "Το πεδίο :attribute πρέπει να είναι αριθμός.", + "required" => "Το πεδίο :attribute είναι απαραίτητο.", + "same" => "Τα πεδία :attribute και :other πρέπει να είναι ίδια.", + "size" => array( + "numeric" => "Το πεδίο :attribute πρέπει να ειναι :size.", + "file" => "Το πεδίο :attribute πρέπει να έχει μέγεθος :size kb.", + "string" => "Το πεδίο :attribute πρέπει να είναι :size χαρακτήρες.", + ), + "unique" => "Το πεδίο :attribute έχει ήδη ανατεθεί.", + "url" => "Το πεδίο :attribute είναι άκυρο.", + + /* + |-------------------------------------------------------------------------- + | Custom Validation Language Lines + |-------------------------------------------------------------------------- + | + | Here you may specify custom validation messages for attributes using the + | convention "attribute_rule" to name the lines. This helps keep your + | custom validation clean and tidy. + | + | So, say you want to use a custom validation message when validating that + | the "email" attribute is unique. Just add "email_unique" to this array + | with your custom message. The Validator will handle the rest! + | + */ + + 'custom' => array(), + + /* + |-------------------------------------------------------------------------- + | Validation Attributes + |-------------------------------------------------------------------------- + | + | The following language lines are used to swap attribute place-holders + | with something more reader friendly such as "E-Mail Address" instead + | of "email". Your users will thank you. + | + | The Validator class will automatically search this array of lines it + | is attempting to replace the :attribute place-holder in messages. + | It's pretty slick. We think you'll like it. + | + */ + + 'attributes' => array(), + +); \ No newline at end of file diff --git a/application/language/gr/pagination.php b/application/language/gr/pagination.php new file mode 100644 index 00000000..1b0a53ae --- /dev/null +++ b/application/language/gr/pagination.php @@ -0,0 +1,19 @@ + '« Προηγούμενο', + 'next' => 'Επόμενο »', + +); \ No newline at end of file diff --git a/application/language/gr/validation.php b/application/language/gr/validation.php new file mode 100644 index 00000000..f461ac0e --- /dev/null +++ b/application/language/gr/validation.php @@ -0,0 +1,104 @@ + "Το πεδίο :attribute πρέπει να εγκριθεί.", + "active_url" => "Το πεδίο :attribute δεν ειναι σωστό URL.", + "after" => "Το πεδίο :attribute πρέπει η ημερομηνία να ειναι μετά :date.", + "alpha" => "Το πεδίο :attribute μπορεί να περιλαμβάνει μόνο γράμματα.", + "alpha_dash" => "Το πεδίο :attribute μπορεί να περιλαμβάνει μόνο γράμματα, αριθμούς και παύλες.", + "alpha_num" => "Το πεδίο :attribute μπορεί να περιλαμβάνει μόνο γράμματα και αριθμούς.", + "array" => "Το πεδίο :attribute πρέπει να περιλαμβάνει επιλεγμένα αντικείμενα.", + "before" => "Το πεδίο :attribute πρέπει η ημερομηνία να ειναι πριν από :date.", + "between" => array( + "numeric" => "Το πεδίο :attribute πρέπει να έχει τιμές μεταξύ :min - :max.", + "file" => "Το πεδίο :attribute πρέπει να ειναι ανάμεσα σε :min - :max kb.", + "string" => "Το πεδίο :attribute πρέπει να περιλαμβάνει :min - :max χαρακτήρες.", + ), + "confirmed" => "Το πεδίο :attribute δεν πέρασε τον έλεγχο.", + "count" => "Το πεδίο :attribute πρέπει να έχει ακριβώς :count επιλεγμένα αντικείμενα.", + "countbetween" => "Το πεδίο :attribute πρέπει να είναι ανάμεσα σε :min και :max επιλεγμένα αντικείμενα.", + "countmax" => "Το πεδίο :attribute πρέπει να έχει λιγότερα από :max επιλεγμένα αντικείμενα.", + "countmin" => "Το πεδίο :attribute πρέπει να έχει τουλάχιστον :min επιλεγμένα αντικείμενα.", + "different" => "Τα πεδία :attribute και :other πρέπει να ειναι διαφορετικά.", + "email" => "Στο πεδίο :attribute η μορφοποίηση ειναι άκυρη.", + "exists" => "Το επιλεγμένο πεδίο :attribute είναι άκυρο.", + "image" => "Το πεδίο :attribute πρέπει να είναι εικόνα.", + "in" => "Το επιλεγμένο πεδίο :attribute είναι άκυρο.", + "integer" => "Το πεδίο :attribute πρέπει να ειναι αριθμός.", + "ip" => "Το πεδίο :attribute πρέπει να ειναι μια έγκυρη διεύθυνση IP.", + "match" => "Το φορμάτ του πεδίου :attribute είναι άκυρο.", + "max" => array( + "numeric" => "Το πεδίο :attribute πρέπει να είναι μικρότερο από :max.", + "file" => "Το πεδίο :attribute πρέπει να είναι μικρότερο από :max kb.", + "string" => "Το πεδίο :attribute πρέπει να έχει λιγότερους από :max χαρακτήρες.", + ), + "mimes" => "Το πεδίο :attribute πρέπει να ειναι αρχείο με τύπο: :values.", + "min" => array( + "numeric" => "Το πεδίο :attribute πρέπει να είναι τουλάχιστον :min.", + "file" => "Το πεδίο :attribute πρέπει να είναι μικρότερο από :max kb.", + "string" => "Το πεδίο :attribute πρέπει να έχει λιγότερους από :max χαρακτήρες.", + ), + "not_in" => "Το επιλεγμένο πεδίο :attribute είναι άκυρο.", + "numeric" => "Το πεδίο :attribute πρέπει να είναι αριθμός.", + "required" => "Το πεδίο :attribute είναι απαραίτητο.", + "same" => "Τα πεδία :attribute και :other πρέπει να είναι ίδια.", + "size" => array( + "numeric" => "Το πεδίο :attribute πρέπει να ειναι :size.", + "file" => "Το πεδίο :attribute πρέπει να έχει μέγεθος :size kb.", + "string" => "Το πεδίο :attribute πρέπει να είναι :size χαρακτήρες.", + ), + "unique" => "Το πεδίο :attribute έχει ήδη ανατεθεί.", + "url" => "Το πεδίο :attribute είναι άκυρο.", + + /* + |-------------------------------------------------------------------------- + | Custom Validation Language Lines + |-------------------------------------------------------------------------- + | + | Here you may specify custom validation messages for attributes using the + | convention "attribute_rule" to name the lines. This helps keep your + | custom validation clean and tidy. + | + | So, say you want to use a custom validation message when validating that + | the "email" attribute is unique. Just add "email_unique" to this array + | with your custom message. The Validator will handle the rest! + | + */ + + 'custom' => array(), + + /* + |-------------------------------------------------------------------------- + | Validation Attributes + |-------------------------------------------------------------------------- + | + | The following language lines are used to swap attribute place-holders + | with something more reader friendly such as "E-Mail Address" instead + | of "email". Your users will thank you. + | + | The Validator class will automatically search this array of lines it + | is attempting to replace the :attribute place-holder in messages. + | It's pretty slick. We think you'll like it. + | + */ + + 'attributes' => array(), + +); \ No newline at end of file diff --git a/application/language/nl/validation.php b/application/language/nl/validation.php index ac0c8416..92ebf53e 100644 --- a/application/language/nl/validation.php +++ b/application/language/nl/validation.php @@ -10,41 +10,41 @@ return array( */ "accepted" => "Het :attribute moet geaccepteerd zijn.", - "active_url" => "Het :attribute is geen geldig URL.", + "active_url" => "Het :attribute is geen geldige URL.", "after" => "Het :attribute moet een datum na :date zijn.", "alpha" => "Het :attribute mag alleen letters bevatten.", "alpha_dash" => "Het :attribute mag alleen letters, nummers, onderstreep(_) en strepen(-) bevatten.", - "alpha_num" => "Het :attribute mag alleen letters en nummers", - "array" => "The :attribute must have selected elements.", + "alpha_num" => "Het :attribute mag alleen letters en nummers bevatten.", + "array" => "Het :attribute moet geselecteerde elementen bevatten.", "before" => "Het :attribute moet een datum voor :date zijn.", "between" => array( "numeric" => "Het :attribute moet tussen :min en :max zijn.", "file" => "Het :attribute moet tussen :min en :max kilobytes zijn.", - "string" => "Het :attribute moet tussen :min en :max tekens zijn.", + "string" => "Het :attribute moet tussen :min en :max karakters zijn.", ), "confirmed" => "Het :attribute bevestiging komt niet overeen.", - "count" => "The :attribute must have exactly :count selected elements.", - "countbetween" => "The :attribute must have between :min and :max selected elements.", - "countmax" => "The :attribute must have less than :max selected elements.", - "countmin" => "The :attribute must have at least :min selected elements.", + "count" => "Het :attribute moet precies :count geselecteerde elementen bevatten.", + "countbetween" => "Het :attribute moet tussen :min en :max geselecteerde elementen bevatten.", + "countmax" => "Het :attribute moet minder dan :max geselecteerde elementen bevatten.", + "countmin" => "Het :attribute moet minimaal :min geselecteerde elementen bevatten.", "different" => "Het :attribute en :other moeten verschillend zijn.", "email" => "Het :attribute formaat is ongeldig.", "exists" => "Het gekozen :attribute is al ingebruik.", "image" => "Het :attribute moet een afbeelding zijn.", "in" => "Het gekozen :attribute is ongeldig.", "integer" => "Het :attribute moet een getal zijn.", - "ip" => "Het :attribute moet een geldig IP adres bevatten.", + "ip" => "Het :attribute moet een geldig IP-adres zijn.", "match" => "Het :attribute formaat is ongeldig.", "max" => array( "numeric" => "Het :attribute moet minder dan :max zijn.", "file" => "Het :attribute moet minder dan :max kilobytes zijn.", - "string" => "Het :attribute moet minder dan :max tekens zijn.", + "string" => "Het :attribute moet minder dan :max karakters zijn.", ), "mimes" => "Het :attribute moet een bestand zijn van het bestandstype :values.", "min" => array( "numeric" => "Het :attribute moet minimaal :min zijn.", "file" => "Het :attribute moet minimaal :min kilobytes zijn.", - "string" => "Het :attribute moet minimaal :min characters zijn.", + "string" => "Het :attribute moet minimaal :min karakters zijn.", ), "not_in" => "Het :attribute formaat is ongeldig.", "numeric" => "Het :attribute moet een nummer zijn.", diff --git a/application/language/pt/pagination.php b/application/language/pt/pagination.php new file mode 100644 index 00000000..e6303530 --- /dev/null +++ b/application/language/pt/pagination.php @@ -0,0 +1,19 @@ + '« Anterior', + 'next' => 'Próxima »', + +); \ No newline at end of file diff --git a/application/language/pt/validation.php b/application/language/pt/validation.php new file mode 100644 index 00000000..6e98fb59 --- /dev/null +++ b/application/language/pt/validation.php @@ -0,0 +1,99 @@ + "O :attribute deve ser aceito.", + "active_url" => "O :attribute não é uma URL válida.", + "after" => "O :attribute deve ser uma data após :date.", + "alpha" => "O :attribute só pode conter letras.", + "alpha_dash" => "O :attribute só pode conter letras, números e traços.", + "alpha_num" => "O :attribute só pode conter letras e números.", + "before" => "O :attribute deve ser uma data anterior à :date.", + "between" => array( + "numeric" => "O :attribute deve estar entre :min - :max.", + "file" => "O :attribute deve estar entre :min - :max kilobytes.", + "string" => "O :attribute deve estar entre :min - :max caracteres.", + ), + "confirmed" => "O :attribute confirmação não coincide.", + "different" => "O :attribute e :other devem ser diferentes.", + "email" => "O :attribute não é um e-mail válido", + "exists" => "O :attribute selecionado é inválido.", + "image" => "O :attribute deve ser uma imagem.", + "in" => "O :attribute selecionado é inválido.", + "integer" => "O :attribute deve ser um inteiro", + "ip" => "O :attribute deve ser um endereço IP válido.", + "match" => "O formato :attribute é inválido.", + "max" => array( + "numeric" => "O :attribute deve ser inferior a :max.", + "file" => "O :attribute deve ser inferior a :max kilobytes.", + "string" => "O :attribute deve ser inferior a :max caracteres.", + ), + "mimes" => "O :attribute deve ser um arquivo do tipo: :values.", + "min" => array( + "numeric" => "O :attribute deve conter pelo menos :min.", + "file" => "O :attribute deve conter pelo menos :min kilobytes.", + "string" => "O :attribute deve conter pelo menos :min caracteres.", + ), + "not_in" => "O :attribute selecionado é inválido.", + "numeric" => "O :attribute deve ser um número.", + "required" => "O campo :attribute deve ser preenchido.", + "same" => "O :attribute e :other devem ser iguais", + "size" => array( + "numeric" => "O :attribute deve ser :size.", + "file" => "O :attribute deve ter :size kilobyte.", + "string" => "O :attribute deve ter :size caracteres.", + ), + "unique" => "O :attribute já existe", + "url" => "O formato :attribute é inválido.", + + /* + |-------------------------------------------------------------------------- + | Custom Validation Language Lines + |-------------------------------------------------------------------------- + | + | Here you may specify custom validation messages for attributes using the + | convention "attribute_rule" to name the lines. This helps keep your + | custom validation clean and tidy. + | + | So, say you want to use a custom validation message when validating that + | the "email" attribute is unique. Just add "email_unique" to this array + | with your custom message. The Validator will handle the rest! + | + */ + + 'custom' => array(), + + /* + |-------------------------------------------------------------------------- + | Validation Attributes + |-------------------------------------------------------------------------- + | + | The following language lines are used to swap attribute place-holders + | with something more reader friendly such as "E-Mail Address" instead + | of "email". Your users will thank you. + | + | The Validator class will automatically search this array of lines it + | is attempting to replace the :attribute place-holder in messages. + | It's pretty slick. We think you'll like it. + | + */ + + 'attributes' => array(), + +); \ No newline at end of file diff --git a/laravel/auth/drivers/eloquent.php b/laravel/auth/drivers/eloquent.php index e376483e..35fe07d2 100644 --- a/laravel/auth/drivers/eloquent.php +++ b/laravel/auth/drivers/eloquent.php @@ -50,7 +50,7 @@ class Eloquent extends Driver { $password_field = Config::get('auth.password', 'password'); - if ( ! is_null($user) and Hash::check($password, $user->get_attribute($password_field))) + if ( ! is_null($user) and Hash::check($password, $user->{$password_field})) { return $this->login($user->id, array_get($arguments, 'remember')); } diff --git a/laravel/blade.php b/laravel/blade.php index f5bed6f4..f0a520ab 100644 --- a/laravel/blade.php +++ b/laravel/blade.php @@ -68,7 +68,7 @@ class Blade { // Once the view has been compiled, we can simply set the path to the // compiled view on the view instance and call the typical "get" // method on the view to evaluate the compiled PHP view. - return $view->get(); + return ltrim($view->get()); }); } diff --git a/laravel/cli/command.php b/laravel/cli/command.php index 113881c2..c6a25ee4 100644 --- a/laravel/cli/command.php +++ b/laravel/cli/command.php @@ -125,7 +125,7 @@ class Command { // the requested method may be executed. if (file_exists($path = Bundle::path($bundle).'tasks/'.$task.EXT)) { - require $path; + require_once $path; $task = static::format($bundle, $task); diff --git a/laravel/cli/tasks/bundle/providers/provider.php b/laravel/cli/tasks/bundle/providers/provider.php index 258500c2..8ac853ff 100644 --- a/laravel/cli/tasks/bundle/providers/provider.php +++ b/laravel/cli/tasks/bundle/providers/provider.php @@ -73,7 +73,7 @@ abstract class Provider { // zip that was put in the storage directory. if ($remote === false) { - throw new \Exception("Error downloading bundle [{$bundle}]."); + throw new \Exception("Error downloading the requested bundle."); } return $remote; diff --git a/laravel/cli/tasks/test/runner.php b/laravel/cli/tasks/test/runner.php index b34e5225..0d9fb4e6 100644 --- a/laravel/cli/tasks/test/runner.php +++ b/laravel/cli/tasks/test/runner.php @@ -86,9 +86,9 @@ class Runner extends Task { // fix the spaced directories problem when using the command line // strings with spaces inside should be wrapped in quotes. - $path = escapeshellarg($path); + $esc_path = escapeshellarg($path); - passthru('phpunit --configuration '.$path, $status); + passthru('phpunit --configuration '.$esc_path, $status); @unlink($path); diff --git a/laravel/cookie.php b/laravel/cookie.php index 1c3b5873..56077ff7 100644 --- a/laravel/cookie.php +++ b/laravel/cookie.php @@ -44,9 +44,14 @@ class Cookie { */ public static function get($name, $default = null) { - if (isset(static::$jar[$name])) return static::$jar[$name]['value']; + if (isset(static::$jar[$name])) return static::parse(static::$jar[$name]['value']); - return array_get(Request::foundation()->cookies->all(), $name, $default); + if ( ! is_null($value = Request::foundation()->cookies->get($name))) + { + return static::parse($value); + } + + return value($default); } /** @@ -75,6 +80,8 @@ class Cookie { $expiration = time() + ($expiration * 60); } + $value = static::hash($value).'+'.$value; + // If the secure option is set to true, yet the request is not over HTTPS // we'll throw an exception to let the developer know that they are // attempting to send a secure cookie over the insecure HTTP. @@ -120,4 +127,46 @@ class Cookie { return static::put($name, null, -2000, $path, $domain, $secure); } + /** + * Hash the given cookie value. + * + * @param string $value + * @return string + */ + public static function hash($value) + { + return hash_hmac('sha1', $value, Config::get('application.key')); + } + + /** + * Parse a hash fingerprinted cookie value. + * + * @param string $value + * @return string + */ + protected static function parse($value) + { + $segments = explode('+', $value); + + // First we will make sure the cookie actually has enough segments to even + // be valid as being set by the application. If it does not we will go + // ahead and throw exceptions now since there the cookie is invalid. + if ( ! (count($segments) >= 2)) + { + return null; + } + + $value = implode('+', array_slice($segments, 1)); + + // Now we will check if the SHA-1 hash present in the first segment matches + // the ShA-1 hash of the rest of the cookie value, since the hash should + // have been set when the cookie was first created by the application. + if ($segments[0] == static::hash($value)) + { + return $value; + } + + return null; + } + } diff --git a/laravel/database/eloquent/model.php b/laravel/database/eloquent/model.php index 306d471a..c2566496 100644 --- a/laravel/database/eloquent/model.php +++ b/laravel/database/eloquent/model.php @@ -452,6 +452,16 @@ abstract class Model { if ( ! $this->exists) $this->created_at = $this->updated_at; } + /** + *Updates the timestamp on the model and immediately saves it. + * + * @return void + */ + public function touch(){ + $this->timestamp(); + $this->save(); + } + /** * Get a new fluent query builder instance for the model. * diff --git a/laravel/documentation/changes.md b/laravel/documentation/changes.md index d9b0ff41..013eb948 100644 --- a/laravel/documentation/changes.md +++ b/laravel/documentation/changes.md @@ -45,6 +45,7 @@ ## Laravel 3.2.8 - Fix double slash bug in URLs when using languages and no "index.php". +- Fix possible security issue in Auth "remember me" cookies. ### Upgrading From 3.2.7 diff --git a/laravel/documentation/database/eloquent.md b/laravel/documentation/database/eloquent.md index cbcf83c9..09493db0 100644 --- a/laravel/documentation/database/eloquent.md +++ b/laravel/documentation/database/eloquent.md @@ -132,6 +132,18 @@ Need to maintain creation and update timestamps on your database records? With E Next, add **created_at** and **updated_at** date columns to your table. Now, whenever you save the model, the creation and update timestamps will be set automatically. You're welcome. +In some cases it may be useful to update the **updated_at** date column without actually modifying any data within the model. Simply use the **touch** method, which will also automatically save the changes immediately: + + $comment = Comment::find(1); + $comment->touch(); + +You can also use the **timestamp** function to update the **updated_at** date column without saving the model immediately. Note that if you are actually modifying the model's data this is handled behind the scenes: + + $comment = Comment::find(1); + $comment->timestamp(); + //do something else here, but not modifying the $comment model data + $comment->save(); + > **Note:** You can change the default timezone of your application in the **application/config/application.php** file. diff --git a/laravel/documentation/views/html.md b/laravel/documentation/views/html.md index 5bcaa389..aabe244d 100644 --- a/laravel/documentation/views/html.md +++ b/laravel/documentation/views/html.md @@ -119,6 +119,8 @@ The "mailto" method on the HTML class obfuscates the given e-mail address so it echo HTML::ol(array('Get Peanut Butter', 'Get Chocolate', 'Feast')); echo HTML::ul(array('Ubuntu', 'Snow Leopard', 'Windows')); + + echo HTML::dl(array('Ubuntu' => 'An operating system by Canonical', 'Windows' => 'An operating system by Microsoft')); ## Custom Macros diff --git a/laravel/documentation/views/pagination.md b/laravel/documentation/views/pagination.md index 95b5479b..081a6f60 100644 --- a/laravel/documentation/views/pagination.md +++ b/laravel/documentation/views/pagination.md @@ -80,29 +80,31 @@ Sometimes you may need to create a Paginator instance manually, without using th All pagination link elements can be style using CSS classes. Here is an example of the HTML elements generated by the links method: