Bug 227199 - net/phpldapadmin: Function mcrypt_module_open() is deprecated.
Summary: net/phpldapadmin: Function mcrypt_module_open() is deprecated.
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Matthew Seaman
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-04-02 10:32 UTC by O. Hartmann
Modified: 2018-04-02 20:14 UTC (History)
0 users

See Also:
bugzilla: maintainer-feedback? (matthew)


Attachments
lib/functions.php patch (2.26 KB, text/plain)
2018-04-02 10:33 UTC, O. Hartmann
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description O. Hartmann 2018-04-02 10:32:45 UTC
When using PHP >= 7.1 (which is necessary due to some serious issues with php 5.6), port net/phpldapadmin fails to work with the error:

Function mcrypt_module_open() is deprecated.

Searching the net for this error reveals that mcrypt has been marked deprecated for PHP >= 7.1. A often mentioned and used workaround is to comment out the routines in question and fall back to BLOWFISH (as I understand this). The attached patch is taken from the web and applies to lib/functions.php, commenting out the call for mcrypt_XXXX() at two places.

This makes net/phpldapadmin (actually phpldapadmin-1.2.3_7,1) working again with lang/php71 as the default php.

The attached patch is considered a workaround.
Comment 1 O. Hartmann 2018-04-02 10:33:57 UTC
Created attachment 192096 [details]
lib/functions.php patch

The attached patch is the promised patch. It won't upload due to a Firefox crash. Sorry.
Comment 2 Matthew Seaman freebsd_committer freebsd_triage 2018-04-02 17:48:17 UTC
Yeah. phpldapadmin hasn't really been maintained for some time, and is now in serious need of updating so it can track upstream changes in PHP.

Let me take a look at the patch.
Comment 3 commit-hook freebsd_committer freebsd_triage 2018-04-02 20:12:48 UTC
A commit references this bug:

Author: matthew
Date: Mon Apr  2 20:11:59 UTC 2018
New revision: 466259
URL: https://svnweb.freebsd.org/changeset/ports/466259

Log:
  Modernization: switch to USES=php:web

  Update files/patch-lib__functions.php to work around the lack of the
  deprecated mcrypt functions in php >= 7.1.

  Regenerate patches with 'make makesum'

  PR:		227199
  Submitted by:	ohartmann@walstatt.org

Changes:
  head/net/phpldapadmin/Makefile
  head/net/phpldapadmin/files/patch-config__config.php.example
  head/net/phpldapadmin/files/patch-lib__PageRender.php
  head/net/phpldapadmin/files/patch-lib__TemplateRender.php
  head/net/phpldapadmin/files/patch-lib__ds_ldap.php
  head/net/phpldapadmin/files/patch-lib__ds_ldap_pla.php
  head/net/phpldapadmin/files/patch-lib__functions.php
  head/net/phpldapadmin/files/patch-tools__po__Makefile
Comment 4 Matthew Seaman freebsd_committer freebsd_triage 2018-04-02 20:14:25 UTC
Committed, thanks!