Skip to content
This repository was archived by the owner on Dec 2, 2018. It is now read-only.

Commit 317f694

Browse files
committed
Also add / to directory for script like Wordpress that assume it
1 parent c20ddd0 commit 317f694

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

lib/rack/legacy/php.rb

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,12 @@ def run(env, path)
3737
config.collect! {|kv| ['-d', kv]}
3838

3939
script, info = *path_parts(path)
40-
script = ::File.join script, 'index.php' if ::File.directory? script
40+
if ::File.directory? script
41+
# If directory then assume index.php
42+
script = ::File.join script, 'index.php';
43+
# Ensure it ends in / which some PHP scripts depend on
44+
path = "#{path}/" unless path =~ /\/$/
45+
end
4146
env['SCRIPT_FILENAME'] = script
4247
env['SCRIPT_NAME'] = strip_public script
4348
env['PATH_INFO'] = info

rack-legacy.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Gem::Specification.new do |s|
22
s.name = 'rack-legacy'
3-
s.version = '0.3.3'
3+
s.version = '0.3.4'
44
s.homepage = 'http://wiki.github.com/eric1234/rack-legacy/'
55
s.author = 'Eric Anderson'
66
s.email = '[email protected]'

0 commit comments

Comments
 (0)