From fc6318504faf1f8f96e6dcb27d809630cc97f8ec Mon Sep 17 00:00:00 2001 From: Stefan Sayer Date: Thu, 21 May 2009 14:57:59 +0000 Subject: [PATCH] also consider %2E as extension delimiter (e.g. for cached files saved as urlencoded) git-svn-id: http://svn.berlios.de/svnroot/repos/sems/trunk@1399 8eb893ce-cfd4-0310-b710-fb5ebe64c474 --- core/AmUtils.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/core/AmUtils.cpp b/core/AmUtils.cpp index 1b799678..be718455 100644 --- a/core/AmUtils.cpp +++ b/core/AmUtils.cpp @@ -564,8 +564,13 @@ int create_unix_socket(const string& path) string file_extension(const string& path) { string::size_type pos = path.rfind('.'); - if(pos == string::npos) - return ""; + if(pos == string::npos){ + pos = path.rfind("%2E"); + + if(pos == string::npos) + return ""; + return path.substr(pos+3,string::npos); + } return path.substr(pos+1,string::npos); }