coar        99/01/04 11:49:46

  Modified:    src      CHANGES
               src/modules/standard mod_autoindex.c
  Log:
        Fix mod_autoindex's handling of SuppressColumnSorting; the
        display order could be manually overridden by putting the
        appropriate query string into the URL (one of the strings
        the column-header anchors used).
  
  Revision  Changes    Path
  1.1201    +6 -0      apache-1.3/src/CHANGES
  
  Index: CHANGES
  ===================================================================
  RCS file: /home/cvs/apache-1.3/src/CHANGES,v
  retrieving revision 1.1200
  retrieving revision 1.1201
  diff -u -r1.1200 -r1.1201
  --- CHANGES   1999/01/04 14:35:54     1.1200
  +++ CHANGES   1999/01/04 19:49:36     1.1201
  @@ -1,5 +1,11 @@
   Changes with Apache 1.3.4
   
  +  *) IndexOptions SuppressColumnSorting only turned off making
  +     the column headers anchors; you could still change the display
  +     order by manually adding a '?N=A' or similar query string to the
  +     URL.  Now SuppressColumnSorting locks in the sort order so
  +     it can't be overridden this way.  [Ken Coar]
  +
     *) Added IndexOrderDefault directive to supply a default sort order
        for FancyIndexed directory listings.  [Ken Coar] PR#1699
   
  
  
  
  1.101     +20 -22    apache-1.3/src/modules/standard/mod_autoindex.c
  
  Index: mod_autoindex.c
  ===================================================================
  RCS file: /home/cvs/apache-1.3/src/modules/standard/mod_autoindex.c,v
  retrieving revision 1.100
  retrieving revision 1.101
  diff -u -r1.100 -r1.101
  --- mod_autoindex.c   1999/01/04 14:35:55     1.100
  +++ mod_autoindex.c   1999/01/04 19:49:41     1.101
  @@ -1365,35 +1365,33 @@
   
       /*
        * Figure out what sort of indexing (if any) we're supposed to use.
  +     *
  +     * If no QUERY_STRING was specified or column sorting has been
  +     * explicitly disabled, we use the default specified by the
  +     * IndexOrderDefault directive (if there is one); otherwise,
  +     * we fall back to ascending by name.
        */
  -    if (autoindex_opts & SUPPRESS_COLSORT) {
  +    qstring = r->args;
  +    if ((autoindex_opts & SUPPRESS_COLSORT)
  +     || ((qstring == NULL) || (*qstring == '\0'))) {
  +     qstring = autoindex_conf->default_order;
  +    }
  +    /*
  +     * If there is no specific ordering defined for this directory,
  +     * default to ascending by filename.
  +     */
  +    if ((qstring == NULL) || (*qstring == '\0')) {
        keyid = K_NAME;
        direction = D_ASCENDING;
       }
       else {
  -     qstring = r->args;
  -
  -     /*
  -      * If no QUERY_STRING was specified, we use the default specified
  -      * by the IndexOrderDefault directive (if there is one); otherwise,
  -      * we fall back to ascending by name.
  -      */
  -     if ((qstring == NULL) || (*qstring == '\0')) {
  -         qstring = autoindex_conf->default_order;
  +     keyid = *qstring;
  +     ap_getword(r->pool, &qstring, '=');
  +     if (qstring != '\0') {
  +         direction = *qstring;
        }
  -     if ((qstring == NULL) || (*qstring == '\0')) {
  -         keyid = K_NAME;
  -         direction = D_ASCENDING;
  -     }
        else {
  -         keyid = *qstring;
  -         ap_getword(r->pool, &qstring, '=');
  -         if (qstring != '\0') {
  -             direction = *qstring;
  -         }
  -         else {
  -             direction = D_ASCENDING;
  -         }
  +         direction = D_ASCENDING;
        }
       }
   
  
  
  

Reply via email to