Skip to content

Security / PHP 7.2 compatibility: create_function() is deprecated #22

@jameswilson

Description

@jameswilson

The function create_function() has been deprecated in PHP 7.2 due to security issues.

The following PHP warning is displayed when viewing a detail record page:

Deprecated function: Function create_function() is deprecated in auto_link() (line 1515 of modules/contrib/edsapi-drupal8-plugin/ebsco.module).
auto_link('XXXXXXXXXXXX') (Line: 1254)
template_preprocess_ebsco_result(Array, 'ebsco_result', Array) (Line: 284)
...

The suggested fix is to replace this:

https://github.com/ebsco/edsapi-drupal8-plugin/blob/f6c435f262c1d8ee0d9777b2591803139e99087b/ebsco.module#L1513-L1520

With an anonymous function. Code example with preg_replace_callback here

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions