Bug #9119
closedPHP error from easyrule with no aliases in the config
100%
Description
When the aliases section of config.xml is empty, easyrule fails with a PHP error:
Fatal error: Uncaught Error: Cannot create references to/from string offsets in /etc/inc/easyrule.inc:166 Stack trace: #0 /etc/inc/easyrule.inc(248): easyrule_block_alias_add('1.2.3.4', 'wan') #1 /etc/inc/easyrule.inc(365): easyrule_block_host_add('1.2.3.4', 'wan', 'inet') #2 /usr/local/bin/easyrule(101): easyrule_parse_block('wan', '1.2.3.4') #3 {main} thrown in /etc/inc/easyrule.inc on line 166 PHP ERROR: Type: 1, File: /etc/inc/easyrule.inc, Line: 166, Message: Uncaught Error: Cannot create references to/from string offsets in /etc/inc/easyrule.inc:166 Stack trace: #0 /etc/inc/easyrule.inc(248): easyrule_block_alias_add('1.2.3.4', 'wan') #1 /etc/inc/easyrule.inc(365): easyrule_block_host_add('1.2.3.4', 'wan', 'inet') #2 /usr/local/bin/easyrule(101): easyrule_parse_block('wan', '1.2.3.4') #3 {main} thrown
Updated by Jim Pingle about 6 years ago
- Status changed from Assigned to Feedback
- % Done changed from 0 to 100
Applied in changeset b55d94e80eeed57e39d33c643bf00be6565c1938.
Updated by Vladimir Lind about 6 years ago
Getting error on 2.4.5-DEVELOPMENT (amd64) built on Wed Nov 14 10:25:41 EST 2018 FreeBSD 11.2-RELEASE-p4:
[2.4.5-DEVELOPMENT][root@pfSense.localdomain]/root: easyrule block wan 1.2.3.4
Warning: Illegal string offset 'alias' in /etc/inc/easyrule.inc on line 163
Warning: Illegal string offset 'alias' in /etc/inc/easyrule.inc on line 166
Fatal error: Uncaught Error: Cannot create references to/from string offsets in /etc/inc/easyrule.inc:166
Stack trace:
#0 /etc/inc/easyrule.inc(248): easyrule_block_alias_add('1.2.3.4', 'wan')
#1 /etc/inc/easyrule.inc(365): easyrule_block_host_add('1.2.3.4', 'wan', 'inet')
#2 /usr/local/bin/easyrule(101): easyrule_parse_block('wan', '1.2.3.4')
#3 {main}
thrown in /etc/inc/easyrule.inc on line 166
PHP ERROR: Type: 1, File: /etc/inc/easyrule.inc, Line: 166, Message: Uncaught Error: Cannot create references to/from string offsets in /etc/inc/easyrule.inc:166
Stack trace:
#0 /etc/inc/easyrule.inc(248): easyrule_block_alias_add('1.2.3.4', 'wan')
#1 /etc/inc/easyrule.inc(365): easyrule_block_host_add('1.2.3.4', 'wan', 'inet')
#2 /usr/local/bin/easyrule(101): easyrule_parse_block('wan', '1.2.3.4')
#3 {main}
Updated by Jim Pingle about 6 years ago
That snapshot is from before the fix was committed. Try again on the next snapshot, or gitsync.
Updated by Vladimir Lind about 6 years ago
2.4.5-DEVELOPMENT (amd64)
built on Wed Nov 14 23:01:04 EST 2018
On this snap - OK.
Updated by Jim Pingle about 6 years ago
- Status changed from Feedback to Resolved