You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by ta...@apache.org on 2009/05/19 16:24:31 UTC

svn commit: r776325 - in /httpd/httpd/trunk: CHANGES modules/mappers/mod_rewrite.c

Author: takashi
Date: Tue May 19 14:24:31 2009
New Revision: 776325

URL: http://svn.apache.org/viewvc?rev=776325&view=rev
Log:
Fix the error string returned by RewriteRule. RewriteRule returned "RewriteCond: bad flag delimiters" when the 3rd argument of RewriteRule was not started with "[" or not ended with "]".

PR: 45082
Submitted by: Vitaly Polonetsky <m_vitaly topixoft.com>

Modified:
    httpd/httpd/trunk/CHANGES
    httpd/httpd/trunk/modules/mappers/mod_rewrite.c

Modified: httpd/httpd/trunk/CHANGES
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/CHANGES?rev=776325&r1=776324&r2=776325&view=diff
==============================================================================
--- httpd/httpd/trunk/CHANGES [utf-8] (original)
+++ httpd/httpd/trunk/CHANGES [utf-8] Tue May 19 14:24:31 2009
@@ -6,6 +6,11 @@
      mod_proxy_ajp: Avoid delivering content from a previous request which
      failed to send a request body. PR 46949 [Ruediger Pluem]
 
+  *) mod_rewrite: Fix the error string returned by RewriteRule.
+     RewriteRule returned "RewriteCond: bad flag delimiters" when the 3rd
+     argument of RewriteRule was not started with "[" or not ended with "]".
+     PR 45082 [Vitaly Polonetsky <m_vitaly topixoft.com>]
+
   *) Windows: Fix usage message.
      [Rainer Jung]
 

Modified: httpd/httpd/trunk/modules/mappers/mod_rewrite.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/mappers/mod_rewrite.c?rev=776325&r1=776324&r2=776325&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/mappers/mod_rewrite.c (original)
+++ httpd/httpd/trunk/modules/mappers/mod_rewrite.c Tue May 19 14:24:31 2009
@@ -3226,7 +3226,7 @@
 
     endp = key + strlen(key) - 1;
     if (*key != '[' || *endp != ']') {
-        return "RewriteCond: bad flag delimiters";
+        return "bad flag delimiters";
     }
 
     *endp = ','; /* for simpler parsing */
@@ -3289,7 +3289,7 @@
         cfg->flags |= CONDFLAG_NOVARY;
     }
     else {
-        return apr_pstrcat(p, "RewriteCond: unknown flag '", key, "'", NULL);
+        return apr_pstrcat(p, "unknown flag '", key, "'", NULL);
     }
     return NULL;
 }
@@ -3338,7 +3338,7 @@
     if (a3 != NULL) {
         if ((err = cmd_parseflagfield(cmd->pool, newcond, a3,
                                       cmd_rewritecond_setflag)) != NULL) {
-            return err;
+            return apr_pstrcat(cmd->pool, "RewriteCond: ", err, NULL);
         }
     }
 
@@ -3585,7 +3585,7 @@
                             ap_index_of_response(HTTP_INTERNAL_SERVER_ERROR);
 
                         if (ap_index_of_response(status) == idx) {
-                            return apr_psprintf(p, "RewriteRule: invalid HTTP "
+                            return apr_psprintf(p, "invalid HTTP "
                                                    "response code '%s' for "
                                                    "flag 'R'",
                                                 val);
@@ -3628,7 +3628,7 @@
     }
 
     if (error) {
-        return apr_pstrcat(p, "RewriteRule: unknown flag '", --key, "'", NULL);
+        return apr_pstrcat(p, "unknown flag '", --key, "'", NULL);
     }
 
     return NULL;
@@ -3674,7 +3674,7 @@
     if (a3 != NULL) {
         if ((err = cmd_parseflagfield(cmd->pool, newrule, a3,
                                       cmd_rewriterule_setflag)) != NULL) {
-            return err;
+            return apr_pstrcat(cmd->pool, "RewriteRule: ", err, NULL);
         }
     }