基于Ruby的Web開發框架 Rails 3.1.2 發布

jopen 14年前發布 | 13K 次閱讀 Ruby

Rails 3.1.2 正式版發布了,該版本包含一些bug修復及安全漏洞的修復,翻譯輔助方法在Ruby on Rails的XSS 漏洞被修復。

Rails 3.1.2 has been released. This is a patch-level release containing bug fixes and an important security fix.

Possible XSS vulnerability in the translate helper method in Ruby on Rails

There is a vulnerability in the translate helper method which may allow an attacker to insert arbitrary code into a page.

  • Versions Affected: 3.0.0 and later, 2.3.X in combination with the rails_xss plugin
  • Not Affected: Pre-3.0.0 releases, without the rails_xss plugin, did no automatic XSS escaping, so are not considered vulnerable
  • Fixed Versions: 3.0.11, 3.1.2

Please see the rubyonrails-security posting and the changelog item below, for more details.

Changes

Action Mailer:

  • No changes

Action Pack:

  • Fix XSS security vulnerability in the translate helper method. When using interpolation in combination with HTML-safe translations, the interpolated input would not get HTML escaped. GH 3664

    Before:

    translate('foo_html', :something => '<script>') # => "...<script>..."

    After:

    translate('foo_html', :something => '<script>') # => "...&lt;script&gt;..."

    Sergey Nartimov

  • Upgrade sprockets dependency to ~> 2.1.0

  • Ensure that the format isn't applied twice to the cache key, else it becomes impossible to target with expire_action.

    Christopher Meiklejohn

  • Swallow error when can't unmarshall object from session.

    Bruno Zanchet

  • Implement a workaround for a bug in ruby-1.9.3p0 where an error would be raised while attempting to convert a template from one encoding to another.

    Please see http://redmine.ruby-lang.org/issues/5564 for details of the bug.

    The workaround is to load all conversions into memory ahead of time, and will only happen if the ruby version is exactly 1.9.3p0. The hope is obviously that the underlying problem will be resolved in the next patchlevel release of 1.9.3.

    Jon Leighton

  • Ensure users upgrading from 3.0.x to 3.1.x will properly upgrade their flash object in session (issues #3298 and #2509)

Active Model:

  • No changes

Active Record:

  • Fix problem with prepared statements and PostgreSQL when multiple schemas are used.GH #3232

    Juan M. Cuello

  • Fix bug with PostgreSQLAdapter#indexes. When the search path has multiple schemas, spaces were not being stripped from the schema names after the first.

    Sean Kirby

  • Preserve SELECT columns on the COUNT for finder_sql when possible. GH 3503

    Justin Mazzi

  • Reset prepared statement cache when schema changes impact statement results. GH 3335

    Aaron Patterson

  • Postgres: Do not attempt to deallocate a statement if the connection is no longer active.

    Ian Leitch

  • Prevent QueryCache leaking database connections. GH 3243

    Mark J. Titorenko

  • Fix bug where building the conditions of a nested through association could potentially modify the conditions of the through and/or source association. If you have experienced bugs with conditions appearing in the wrong queries when using nested through associations, this probably solves your problems. GH #3271

    Jon Leighton

  • If a record is removed from a has_many :through, all of the join records relating to that record should also be removed from the through association's target.

    Jon Leighton

  • Fix adding multiple instances of the same record to a has_many :through. GH #3425

    Jon Leighton

  • Fix creating records in a through association with a polymorphic source type. GH #3247

    Jon Leighton

  • MySQL: use the information_schema than the describe command when we look for a primary key. GH #3440

    Kenny J

Active Resource:

  • No changes

Active Support:

  • No changes

Railties:

  • Engines: don't blow up if db/seeds.rb is missing.

    Jeremy Kemper

  • rails new foo --skip-test-unit should not add the :test task to the rake default task.GH 2564

    José Valim

As ever, you can see a full list of commits between the versions on Github.


rails.png

Ruby on Rails 是一個用于開發數據庫驅動的網絡應用程序的完整框架。Rails基于MVC(模型- 視圖- 控制器)設計模式。從視圖中的Ajax應用,到控制器中的訪問請求和反饋,到封裝數據庫的模型,Rails 為你提供一個純Ruby的開發環境。發布網站時,你只需要一個數據庫和一個網絡服務器即可。

Ruby On Rails是一個用于編寫網絡應用程序的軟件包.它基于一種計算機軟件語言Ruby,給程序開發人員提供了強大的框架支持.你可以用比以前少的多的代碼和 短的多的時間編寫出一流的網絡軟件.比較著名的社區網站43things.com, odeo.com和basecamphq.com就是用Ruby On Rails編寫的.

Ruby On Rails的指導原則是”不要重復你自己”(Don’t Repeat Yourself, 或DRY).意思是說你寫的代碼不會有重復的地方.比如以往數據庫的接口往往是類似的程序代碼但是在很多地方都要重復用到.這無論是給編寫還是維護都造成 了很大的代價.相反,Ruby On Rails給你提供了絕大多數的支持,讓你只需要短短的幾行代碼就可以實現強大的功能.而且,Rails提供了代碼生成工具,讓你甚至不需要編寫一行代碼 就實現強大的管理程序.

Ruby On Rails通過reflection和runtime extension減少了對configuration文件的依靠,這和Java,C#語言的方向有很大不同,讓你減少了很多配置和部署的麻煩,但是性能上卻完全可以應付一般網站的需求.

Rails 支持各類網絡服務器和數據庫。在服務器方面,我們推薦Apache、 lighttpd 或 nginx 代理至 Mongrel (或者使用FastCGI)。 數據庫方面,你可以采用MySQL、PostgreSQL、 SQLite、 Oracle、 SQL Server、 DB2、 或其他任何我們支持的系統。 Rails可以在各類操作系統上運行,不過我們建議采用基于'nix的系統進行開發。

 本文由用戶 jopen 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
 轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
 本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!