aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--actionpack/CHANGELOG2
-rwxr-xr-xactionpack/lib/action_controller/request.rb10
2 files changed, 6 insertions, 6 deletions
diff --git a/actionpack/CHANGELOG b/actionpack/CHANGELOG
index c3a771e6d2..0e0b47f584 100644
--- a/actionpack/CHANGELOG
+++ b/actionpack/CHANGELOG
@@ -1,5 +1,7 @@
*SVN*
+* Ensure that request.path never returns nil. Closes #1675 [Nicholas Seckar]
+
* Add ability to specify Route Regexps for controllers. Closes #1917. [Sebastian Kanthak]
* Provide Named Route's hash methods as helper methods. Closes #1744. [Nicholas Seckar, Steve Purcell]
diff --git a/actionpack/lib/action_controller/request.rb b/actionpack/lib/action_controller/request.rb
index ca8dfff161..c3d440d815 100755
--- a/actionpack/lib/action_controller/request.rb
+++ b/actionpack/lib/action_controller/request.rb
@@ -158,12 +158,10 @@ module ActionController
path = (uri = request_uri) ? uri.split('?').first : ''
# Cut off the path to the installation directory if given
- if root = relative_url_root
- path[root.length..-1]
- else
- path
- end
- end
+ root = relative_url_root
+ path[0, root.length] = '' if root
+ path || ''
+ end
# Returns the path minus the web server relative installation directory.
# This method returns nil unless the web server is apache.