Project

General

Profile

Bug #7202

"Warning: sprintf(): Too few arguments in /usr/local/www/classes/Form/Group.class.php on line 65 Call Stack:

Added by Martin Wasley 10 months ago. Updated 9 months ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
Web Interface
Target version:
Start date:
02/03/2017
Due date:
% Done:

100%

Affected Version:
2.4
Affected Architecture:

Description

Problem with changes to the setHelp function or calls to it.

Associated revisions

Revision 4b329613
Added by Steve Beaver 10 months ago

Fix #7202
Fix several sprintf errors by escaping '%'s and removing '[ ]' which had been use to pass arguments to setHelp as an array.

History

#1 Updated by Steve Beaver 10 months ago

  • Assignee set to Steve Beaver

I knew there would be some :) Could you attach the call stack or tell me which page you had selected when this occured?

#2 Updated by Steve Beaver 10 months ago

  • Status changed from New to Feedback
  • Assignee changed from Steve Beaver to Martin Wasley

#3 Updated by Martin Wasley 10 months ago

Posted by one of my testers after patching one of mine for testing, this is what he posted,

Martin if I goto the edit gateway page (where can toggle monitoring), this appears at the top as a warning, is it related to your patch or an issue with the snapshot you think?

"Warning: sprintf(): Too few arguments in /usr/local/www/classes/Form/Group.class.php on line 65 Call Stack:
0.0165 234504 1. {main}() /usr/local/www/system_gateways_edit.php:0
0.1515 2453688 2. Form_Group->setHelp()
/usr/local/www/system_gateways_edit.php:741 0.1515 2454312 3.
call_user_func_array:{/usr/local/www/classes/Form/Group.class.php:65}()
/usr/local/www/classes/Form/Group.class.php:65 0.1515 2454784 4.
sprintf() /usr/local/www/classes/Form/Group.class.php:65 Warning:
sprintf(): Too few arguments in
/usr/local/www/classes/Form/Group.class.php on line 65 Call Stack:
0.0165 234504 1. {main}() /usr/local/www/system_gateways_edit.php:0
0.1527 2458608 2. Form_Group->setHelp()
/usr/local/www/system_gateways_edit.php:761 0.1528 2459232 3.
call_user_func_array:{/usr/local/www/classes/Form/Group.class.php:65}()
/usr/local/www/classes/Form/Group.class.php:65 0.1528 2459704 4.
sprintf() /usr/local/www/classes/Form/Group.class.php:65"

#4 Updated by Martin Wasley 10 months ago

Just double checked it's not my patch. :) Clean snapshot update shows it.

#5 Updated by Steve Beaver 10 months ago

Thanks. Looks like there are a few embedded '%' that now need to be escaped, and arguments passed as an array in [ ] s.

Pushed fixes to

system_gateways_edit.php
services_dyndns_edit.php

#6 Updated by Steve Beaver 10 months ago

  • % Done changed from 0 to 100

#7 Updated by Dustin Dembeck 10 months ago

I am seeing a similar error on System -> Advanced -> Firewall & NAT

Warning: sprintf(): Too few arguments in /usr/local/www/classes/Form/Input.class.php on line 121 Call Stack: 0.0051 232712 1. {main}() /usr/local/www/system_advanced_firewall.php:0 0.1040 1555888 2. Form_Input->setHelp() /usr/local/www/system_advanced_firewall.php:451 0.1040 1556608 3. call_user_func_array:{/usr/local/www/classes/Form/Input.class.php:121}() /usr/local/www/classes/Form/Input.class.php:121 0.1040 1556992 4. sprintf() /usr/local/www/classes/Form/Input.class.php:121 Warning: sprintf(): Too few arguments in /usr/local/www/classes/Form/Input.class.php on line 121 Call Stack: 0.0051 232712 1. {main}() /usr/local/www/system_advanced_firewall.php:0 0.1049 1558032 2. Form_Input->setHelp() /usr/local/www/system_advanced_firewall.php:463 0.1049 1558800 3. call_user_func_array:{/usr/local/www/classes/Form/Input.class.php:121}() /usr/local/www/classes/Form/Input.class.php:121 0.1049 1559184 4. sprintf() /usr/local/www/classes/Form/Input.class.php:121

#8 Updated by Luke Hamburg 10 months ago

Seeing the same issue as Dustin on System > Advanced > Firewall. Tested with 2.4.0.b.20170203.2002.

#9 Updated by Steve Beaver 10 months ago

Fixed. Thanks for finding those. Embedded '%' that needed to be escaped.

#10 Updated by Jakub Osika 10 months ago

SG-1000
2.4.0.b.20170204.2301

I was getting this issue on the Status Page. Can confirm that it is now resolved.

However I am still seeing error in:
System -> Advanced -> Firewall & NAT
Warning: sprintf(): Too few arguments in /usr/local/www/classes/Form/Input.class.php on line 121 Call Stack: 0.0361 122800 1. {main}() /usr/local/www/system_advanced_firewall.php:0 0.7140 1049040 2. Form_Input->setHelp() /usr/local/www/system_advanced_firewall.php:451 0.7141 1049568 3. call_user_func_array:{/usr/local/www/classes/Form/Input.class.php:121}() /usr/local/www/classes/Form/Input.class.php:121 0.7142 1049784 4. sprintf() /usr/local/www/classes/Form/Input.class.php:121 Warning: sprintf(): Too few arguments in /usr/local/www/classes/Form/Input.class.php on line 121 Call Stack: 0.0361 122800 1. {main}() /usr/local/www/system_advanced_firewall.php:0 0.7171 1050272 2. Form_Input->setHelp() /usr/local/www/system_advanced_firewall.php:463 0.7172 1050848 3. call_user_func_array:{/usr/local/www/classes/Form/Input.class.php:121}() /usr/local/www/classes/Form/Input.class.php:121 0.7173 1051064 4. sprintf() /usr/local/www/classes/Form/Input.class.php:121

Two more pages where I have noticed similar behaviour, but I'm not sure if this is pfsense or squid package specific:

Services > Squid Proxy Server > Local Cache
Warning: sprintf(): Too few arguments in /usr/local/www/classes/Form/Input.class.php on line 121 Call Stack: 0.0007 122288 1. {main}() /usr/local/www/pkg_edit.php:0 2.5202 1208536 2. Form_Input->setHelp() /usr/local/www/pkg_edit.php:750 2.5203 1209272 3. call_user_func_array:{/usr/local/www/classes/Form/Input.class.php:121}() /usr/local/www/classes/Form/Input.class.php:121 2.5204 1209488 4. sprintf() /usr/local/www/classes/Form/Input.class.php:121

Services > Squid Proxy Server > Traffic Mgmt
Warning: sprintf(): Too few arguments in /usr/local/www/classes/Form/Input.class.php on line 121 Call Stack: 0.0006 122328 1. {main}() /usr/local/www/pkg_edit.php:0 5.7802 1166752 2. Form_Input->setHelp() /usr/local/www/pkg_edit.php:750 5.7804 1167104 3. call_user_func_array:{/usr/local/www/classes/Form/Input.class.php:121}() /usr/local/www/classes/Form/Input.class.php:121 5.7805 1167320 4. sprintf() /usr/local/www/classes/Form/Input.class.php:121

#11 Updated by Steve Beaver 10 months ago

System -> Advanced -> Firewall & NAT has already been fixes and will be in the next snap
The two Squid warnings were errors in the XML which I have just fixed (by escaping '%'s)
Thanks for the report.

#12 Updated by Jakub Osika 10 months ago

I just did a click through every page that my device has and found one more for which I couldn't find an existing report:

Services > DNS Resolver > Advanced Settings
Warning: sprintf(): Too few arguments in /usr/local/www/classes/Form/Input.class.php on line 121 Call Stack: 0.0257 122104 1. {main}() /usr/local/www/services_unbound_advanced.php:0 0.8624 1033880 2. Form_Input->setHelp() /usr/local/www/services_unbound_advanced.php:233 0.8626 1034320 3. call_user_func_array:{/usr/local/www/classes/Form/Input.class.php:121}() /usr/local/www/classes/Form/Input.class.php:121 0.8627 1034536 4. sprintf() /usr/local/www/classes/Form/Input.class.php:121

#13 Updated by Steve Beaver 10 months ago

Got it. Thanks.

#14 Updated by James Snell 10 months ago

  • System > Advanced > Firewall & NAT
  • Services > DNS Resolver > Advanced

Tested, no PHP errors displayed in build 2.4.0.b.20170205.1945
Thanks!

#15 Updated by Helio Tadao Goto 10 months ago

Installed build 2.4.0.b.20170207-1441 and same errors appears in

  • Services > Squid Proxy Server
  • Services > SquidGuard Proxy Filter
  • Services > SquidGuard Proxy Filter > Common ACL
    In this last one, it doesn't show Target Rules List bar (the same occurs in the other tabs for Groups ACL too, what means we can't configure the blacklists allow,deny options)

#16 Updated by Helio Tadao Goto 9 months ago

This problem remains with SquidGuard, in several tabs, like this in

Services > SquidGuard Proxy Filter > Common ACL :

Warning: sprintf(): Too few arguments in /usr/local/www/classes/Form/Input.class.php on line 122 Call Stack: 0.0002 231312 1. {main}() /usr/local/www/pkg_edit.php:0 0.1428 2742320 2. Form_Input->setHelp() /usr/local/www/pkg_edit.php:750 0.1428 2742768 3. call_user_func_array:{/usr/local/www/classes/Form/Input.class.php:122}() /usr/local/www/classes/Form/Input.class.php:122 0.1429 2743152 4. sprintf() /usr/local/www/classes/Form/Input.class.php:122

#17 Updated by Steve Beaver 9 months ago

  • Assignee changed from Martin Wasley to Steve Beaver

#18 Updated by Steve Beaver 9 months ago

Fixed embedded '%' in squidguard.inc

#19 Updated by Steve Beaver 9 months ago

This problem has now been fixed in a more generic within the Form classes so there should be no other cases, with or without embedded '%' characters.

https://github.com/pfsense/pfsense/commit/c74b018d42c02e0ee4e4a25e61db654c9f6caf63

#20 Updated by Helio Tadao Goto 9 months ago

I navigated in almost all screens previously affected and can confirm everything is fixed with the pages previously affected.

#21 Updated by Steve Beaver 9 months ago

  • Status changed from Feedback to Resolved

Also available in: Atom PDF