View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0008267 | mantisbt | sql | public | 2007-08-16 04:30 | 2019-12-13 18:06 |
Reporter | opi | Assigned To | dregad | ||
Priority | normal | Severity | major | Reproducibility | always |
Status | closed | Resolution | no change required | ||
Summary | 0008267: APPLICATION ERROR #203 - A number was expected for filter. | ||||
Description | Hi Here is a step by step procedure to reproduce the issue:
(The Bad thing it's not displayed in IE or Firefox but If i enable "$g_show_detailed_errors" the Page show follow: Begin Error Message APPLICATION ERROR #203 Full path: pub/mantis/core/gpc_api.php args Filename Line Function Args Previous non-fatal errors occurred. Page contents follow. End Error Message I guess i get this because all types are strings but the I hope you can have a look at this and hopefully also fix the issue. Best Regards | ||||
Tags | patch | ||||
Attached Files | gpc_get_int.diff (486 bytes)
Index: core/gpc_api.php =================================================================== --- core/gpc_api.php (revision 400) +++ core/gpc_api.php (working copy) @@ -71,7 +71,7 @@ trigger_error( ERROR_GPC_ARRAY_UNEXPECTED, ERROR ); } $t_val = str_replace( " ", "", trim( $t_result ) ); - if ( ! preg_match( "/^-?([0-9])*$/", $t_val ) ) { + if ( ! sscanf($t_val, "%d", $t_val) ) { error_parameters( $p_var_name ); trigger_error( ERROR_GPC_NOT_NUMBER, ERROR ); } | ||||
Hi I investigate the issue a little bit. Is it possible that in the File view_all_inc.php in the Lines Best Regards |
|
Hello, I got the similar error with Mantis 1.0.8: Please use the "Back" button in your web browser to return to the previous page. There you can correct whatever problems were identified in this error or select another action. You can also click an option from the menu bar to go directly to a new section. Full path: /data/Q03PHP/httpd-dvpt/htdocs.dvpt/core/gpc_api.php args Filename Line Function Args I corrected it replacing in view_all_set.php line 230 a gpc_get_int()? by a gpc_get_string() BUT I do not manage the consequence of that. BR, |
|
I've uploaded a small patch that changes the behaviour of gpc_get_int. This should fix these problems. I changed it to use sscanf so that it would still work if attempting to get an integer value from something parseable, but not containing only digits. |
|
I can't see anything wrong with the original regex, (i've never seen this myself) PAul |
|
grangeway, You can get it to occur in many ways, one is entering a strange id for a bug: http://www.mantisbt.org/bugs/view.php?id=826--7 . My patch basically does a best effort attempt to read a number from the beginning of $t_val, and if something's there that fits (even if something on the end isn't numeric, etc) it uses that. |
|
Why you ask how exactly i get this to occur? But here again:
Now you should see the errormessage... Best Regards |
|
I think that the filter storage may be corrupted. Could you post the results from the following query? SELECT * FROM mantis_filters_table WHERE user_id=<your userid>; Another thought is that your browser has remembered a URL with broken information in it. Could you clear your browser cache, history, and cookies for the site? |
|
Hmm i really don't know what you mean but i do the follow: Log in to phpMyAdmin (2.11.4), select the correct Database, The resulting file will be attached to this Issue. I hope that is what you want. If not please let me know. BTW: i still run the old Mantis 1.2.0a1 Version. Best Regards |
|
bbryant: I think that given your example, we are doing the right thing. There can never be a bug 826--7. Your patch doesn't change this (It just accepts the erroneous data and displays bug 827 instead). opi: The saved filters look correct. We do may use a browser cookie to save the filter information between sessions. It is possible that this has been corrupted. Can you log out of Mantis, clear the cookies related to the site, and retest this? |
|
opi, You can find nightly snapshots at http://git.mantisbt.org/ |
|
thraxisp thanks for the link for the nightly snapshots. I test the issue again with the latest version and the In view_all_inc.php (Line 164) is this call: so i add some debug output to this function and get $args=Array So call_user_func_array( gpc_get, $args ) return 'Apply Filter' So the fault is in this line (received from the Server): because the Browser add the name="filter" with the value="Apply Filter" The easy solution is to remove the name="filter" from the input tag, I guess here are some other submit buttons with a not needed name in Best Regards |
|
i forget to mention thet the page is buld in view_filters_page.php BTW: why the action = "view_all_set.php?f=3" Best Regards |
|
We are resolving this issue as "no change required", because it was reported against an old version of MantisBT which is no longer supported. We recommend that you upgrade to the latest stable version [1]; if after doing so the problem still exists, do not hesitate to reopen the issue. |
|