ionCube Logo
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


 
Post new topic   Reply to topic    ionCube Forum Index -> Programming

Obfus. functions breaks register_shutdown_function

Author Message
horf



Joined: 27 Nov 2015
Posts: 4

PostPosted: Fri Nov 27, 2015 1:28 pm    Post subject: Obfus. functions breaks register_shutdown_function Reply with quote

I would like to obfuscate the functions in our project, but in register_shutdown_function('earlyFatalErrorHandler'), the function name is not replaced by the obfuscated name.

Example test_errorHandler.php:
Code:
<?php

function earlyFatalErrorHandler()
{
   die('Succeeded: Error catcher');
}

register_shutdown_function('earlyFatalErrorHandler');
spl_autoload_register('foo'); // test: throw a fatal error


Expected result:
Quote:
Succeeded: Error catcher


Result (the fatal PHP error may not be caught):
Quote:
( ! ) Warning: [obfuscated](): Invalid shutdown callback 'earlyFatalErrorHandler' passed in test_errorHandler.php on line 0

( ! ) Fatal error: Uncaught exception 'LogicException' with message 'Function 'foo' not found (function 'foo' not found or invalid function name)' in test_errorHandler.php on line 0
( ! ) LogicException: Function 'foo' not found (function 'foo' not found or invalid function name) in test_errorHandler.php on line 0


Do you plan to support this case?
Quote:
Back to top
View user's profile Send private message
horf



Joined: 27 Nov 2015
Posts: 4

PostPosted: Fri Nov 27, 2015 3:24 pm    Post subject: 106 Reply with quote

I've made a workaround by creating the following exclusion list:
Quote:
[functions]
earlyFatalErrorHandler
Back to top
View user's profile Send private message
liaison
ionCube Support


Joined: 16 Dec 2004
Posts: 2754

PostPosted: Fri Nov 27, 2015 9:34 pm    Post subject: Reply with quote

Thanks for posting, and that's actually the solution and not a workaround Smile
_________________
Community Admin
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    ionCube Forum Index -> Programming All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum