--- parser3/src/classes/file.C 2024/10/22 10:34:00 1.284 +++ parser3/src/classes/file.C 2024/11/06 21:56:23 1.286 @@ -1,7 +1,7 @@ /** @file Parser: @b file parser class. - Copyright (c) 2001-2023 Art. Lebedev Studio (http://www.artlebedev.com) + Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian */ @@ -27,7 +27,7 @@ #include "pa_vregex.h" #include "pa_version.h" -volatile const char * IDENT_FILE_C="$Id: file.C,v 1.284 2024/10/22 10:34:00 moko Exp $"; +volatile const char * IDENT_FILE_C="$Id: file.C,v 1.286 2024/11/06 21:56:23 moko Exp $"; // defines @@ -563,6 +563,15 @@ static void _exec_cgi(Request& r, Method throw Exception(PARSER_RUNTIME, 0, "param must be string or table or array of strings"); } } + + // remove trailing empty arguments for backward compatibility + for(ArrayString::ReverseIterator i(argv); i;){ + if(i.prev()->is_empty()){ // here for correct i.index() + argv.remove(i.index()); + } else { + break; + } + } } // transcode if necessary