Changeset 3020


Ignore:
Timestamp:
2002-02-28T11:54:51+13:00 (22 years ago)
Author:
jrm21
Message:

Check to see if there is a URI-encoded space in the name of an associated
file (eg /collect/my%20col/index/assoc/0/0.png). Won't work if there are
more than 1 space though....

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/src/w32server/cgiwrapper.cpp

    r2997 r3020  
    661661  // try to open the file
    662662  filename = filename_cat (current_gsdlhome, filename);
     663  /* Feb 2002 - handle a file with a space in it's name.
     664     Assume that if there is a space, it is in the collect name (and there's
     665     only one space). */
     666  text_t::iterator space_start;
     667  space_start=findword(filename.begin(),filename.end(),"%20");
     668  if (space_start != filename.end()) {
     669    // we found a space...
     670    text_t::iterator after_space=space_start+3;
     671    text_t new_filename=substr(filename.begin(), space_start);
     672    new_filename += " ";
     673    new_filename += substr(after_space,filename.end());
     674    filename=new_filename;
     675  }
     676
    663677  char *filenamec = filename.getcstr();
    664678  FILE *thefile = fopen(filenamec, "rb");
     
    670684    return;
    671685  }
    672 
    673686  int nr;
    674687  char buffer[2048];
Note: See TracChangeset for help on using the changeset viewer.