The following warnings occurred:
Warning [2] Undefined array key "avatartype" - Line: 783 - File: global.php PHP 8.1.27 (Linux)
File Line Function
/global.php 783 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined array key "avatartype" - Line: 783 - File: global.php PHP 8.1.27 (Linux)
File Line Function
/global.php 783 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined variable $newpmmsg - Line: 40 - File: global.php(841) : eval()'d code PHP 8.1.27 (Linux)
File Line Function
/global.php(841) : eval()'d code 40 errorHandler->error
/global.php 841 eval
/printthread.php 16 require_once
Warning [2] Undefined array key "style" - Line: 909 - File: global.php PHP 8.1.27 (Linux)
File Line Function
/global.php 909 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined property: MyLanguage::$lang_select_default - Line: 5024 - File: inc/functions.php PHP 8.1.27 (Linux)
File Line Function
/inc/functions.php 5024 errorHandler->error
/global.php 909 build_theme_select
/printthread.php 16 require_once
Warning [2] Undefined array key "additionalgroups" - Line: 7162 - File: inc/functions.php PHP 8.1.27 (Linux)
File Line Function
/inc/functions.php 7162 errorHandler->error
/inc/functions.php 5044 is_member
/global.php 909 build_theme_select
/printthread.php 16 require_once
Warning [2] Undefined array key 1 - Line: 1415 - File: inc/functions.php PHP 8.1.27 (Linux)
File Line Function
/inc/functions.php 1415 errorHandler->error
/inc/functions.php 1370 fetch_forum_permissions
/printthread.php 76 forum_permissions
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 165 errorHandler->error



Form Tools
File uploads' filenames losing numeric values - Printable Version

+- Form Tools (https://forums.formtools.org)
+-- Forum: Form Tools (https://forums.formtools.org/forumdisplay.php?fid=1)
+--- Forum: General Discussion (https://forums.formtools.org/forumdisplay.php?fid=5)
+--- Thread: File uploads' filenames losing numeric values (/showthread.php?tid=877)



File uploads' filenames losing numeric values - craven - Oct 4th, 2010

Hi Ben.

We've recently had issues with file uploads coming through blank or just not submitting any of the files. This turned out to be due to the filenames consisting completely out of numeric values.

Upon further inspection, I found that what seems to happen with Form Tools' file submission/upload process, is that all numeric values are stripped as are all spaces (which is to be expected).

We tested this on a live Form Tools site and database which we've upgraded to a 2.0.* version of Form Tools. We then also tested this occurence on a clean installation of the latest version of Form Tools with a clean database and clean form (plain HTML). The results are consistent were consistent with our previous findings.

I'm assuming this is by design? But if so, before we upgraded to this version, file uploads' filenames seemed to have been kept in tact if unique and only renamed when not unique.

Is there a way around this? I'm asking since we need a way of making file uploads unique, and one way would be using a "site ID" which include alphanumeric values. I was thinking along the lines of prefixing this ID with the pre-parser, but if the numbers get stripped during the processing then the IDs would become inaccurate.

Just a couple of thoughts. Thanks for your time.


RE: File uploads' filenames losing numeric values - Ben - Oct 5th, 2010

Hi Craven,

Drat... Yes, the numeric values would get stripped out from filenames - that was daft of me. I'll fix this in 2.0.5.

The problem was that people were uploading files that had valid filenames on one filesystem, but caused the server to choke. Simple things like apostrophes or spaces in the filenames could cause problems on the server. To solve it, I added a whitelist character setting to the library.php file that strips out anything that isn't specified.

To fix it for your installation, just add the following variable to your config.php file:

PHP Code:
$g_filename_char_whitelist "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_-"

That will then permit numeric characters as well as the others. You can actually add any character there, in addition to the default chars.

Sorry for the confusion!

- Ben


RE: File uploads' filenames losing numeric values - craven - Oct 5th, 2010

Thanks for the swift reply Ben! And thanks for the help. Much appreciated.