Permalink
Browse files

Fixing regression and CliQuercus NPE issue

  • Loading branch information...
Kdecherf committed Apr 23, 2011
1 parent c883812 commit 9f8f6e2554ddf72b84cd6775aec258ee64bef45e
Showing with 21 additions and 8 deletions.
  1. +11 −0 build.gradle
  2. +10 −8 quercus/src/main/java/com/caucho/quercus/env/Env.java
View
@@ -19,6 +19,10 @@ project(':resin') {
}
project(':quercus') {
+ configurations {
+ runtime.extendsFrom compile
+ }
+
dependencies {
compile project(':resin')
compile "org.bouncycastle:bcprov-jdk16:1.46", "org.bouncycastle:bcpg-jdk16:1.46", "org.bouncycastle:bcmail-jdk16:1.46", "org.bouncycastle:bctsp-jdk16:1.46"
@@ -37,6 +41,13 @@ project(':quercus') {
jar.dependsOn cleanJava
metaInf << file('src/main/java/META-INF/')
+
+ task libs(type: Copy) {
+ from configurations.runtime
+ into "$buildDir/libs"
+ exclude("javaee-api*.jar")
+ }
+ jar.dependsOn libs
}
project(':app') {
@@ -355,14 +355,16 @@ public Env(QuercusContext quercus,
addConstant("PHP_CONFIG_FILE_SCAN_DIR", new ConstStringValue(getPwd() + "WEB-INF/"), true);
// c#0004403 - #27
- String _authHeader = request.getHeader("authorization");
- if (_authHeader != null) {
- _authRequest = _authHeader.split(" ");
- if (_authRequest[0].equals("Basic")) {
- // BASIC auth
- String[] _auth64 = Base64.decode(_authRequest[1]).split(":");
- getGlobalVar("_SERVER").put(new ConstStringValue("PHP_AUTH_USER"), new ConstStringValue(_auth64[0]));
- getGlobalVar("_SERVER").put(new ConstStringValue("PHP_AUTH_PW"), new ConstStringValue(_auth64[1]));
+ if (request != null) {
+ String _authHeader = request.getHeader("authorization");
+ if (_authHeader != null) {
+ _authRequest = _authHeader.split(" ");
+ if (_authRequest[0].equals("Basic")) {
+ // BASIC auth
+ String[] _auth64 = Base64.decode(_authRequest[1]).split(":");
+ getGlobalVar("_SERVER").put(new ConstStringValue("PHP_AUTH_USER"), new ConstStringValue(_auth64[0]));
+ getGlobalVar("_SERVER").put(new ConstStringValue("PHP_AUTH_PW"), new ConstStringValue(_auth64[1]));
+ }
}
}

0 comments on commit 9f8f6e2

Please sign in to comment.