Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.1.0

Bug #21208 use a proper __construct
Submitted: 2017-05-05 17:36 UTC
From: jefkin Assigned: jderks
Status: Assigned Package: Crypt_Xtea (version 1.1.0)
PHP Version: HEAD SVN-2017-05-05 OS: CentOS
Roadmaps: (Not assigned)    
Subscription  


 [2017-05-05 17:36 UTC] jefkin (Jeff Brown)
Description: ------------ This should be a one line change: file: Crypt/Xtea.php line 145; for compatibility for php 7.0 and up, replace Crypt_Xtea() with __construct(). On my local side I also updated the comment on line 136 to read: // {{{ Crypt_Xtea::__construct() I noticed that the php version you list on this form doesn't include php7.0 and so I understand you may reject this bug for that reason, but the change I'm requesting, would ensure that should 7.0 begin to be supported, that Crypt Xtea would work as expected out of the box. If you do reject it, I'll simply hack it in on my local copy. Test script: --------------- Any require or require_once of Xtea in a php script running on php 7.0 or higher will give a very ugly hard to trap warning. E.g. the test script. <?php require_once 'Crypt/Xtea.php'; $data = 'abcdefghijklmnopqrstuvwxyz'; $key = '0123456789abcdef'; $crypt = new Crypt_Xtea(); $encrypted = $crypt->encrypt($data, $key); $decrypted = $crypt->encrypt($encrypt, $key); ?> Expected result: ---------------- Xtea to run correctly. Actual result: -------------- PHP Fatal error: require(): Failed opening required 'Crypt/Xtea.php' (include_path='/usr/share/php5/PEAR') in /srv/www/virthosts/publix/sites/all/libraries/Xtea/Xtea.php on line 10

Comments

 [2017-05-09 09:07 UTC] jderks (Jeroen Derks)
Thanks for the bug report. I will look into it ASAP.
 [2017-05-09 09:08 UTC] jderks (Jeroen Derks)
-Status: Open +Status: Assigned -Assigned To: +Assigned To: jderks
 [2017-05-09 18:15 UTC] ashnazg (Chuck Burgess)
jefkin already issued a PR (https://github.com/pear/Crypt_Xtea/pull/2)