Commit 52e92354 authored by Damien McKenna's avatar Damien McKenna Committed by Jacob Friis Mathiasen
Browse files

Issue #3174496 by damienmckenna: PHP 7.4 errors in Field Hidden.

parent e4bbdcca
Loading
Loading
Loading
Loading
+4 −4
Changes for field_hidden.admin.inc: 4 added lines, 4 removed lines.
Original line number Diff line number Diff line
@@ -187,16 +187,16 @@ function _field_hidden_readme2html($readme_txt, $headline_tag = 'h5') {
    //'',
  );
  $s = preg_replace($ndls, $rplcs, $s);
  //  Links may be followed by a punctuation marker, hard to detect without a callback.
  //  And http://your-drupal-site.tld/path should become /path
  // Links may be followed by a punctuation marker, hard to detect without a
  // callback. And "http://your-drupal-site.tld/path" should become "/path".
  $s = preg_replace_callback(
    '/(https?\:\/\/)(\S+)([\x20\t\n])/',
    function ($ms) {
      $protocol = $ms[1];
      $le = strlen($addr = $ms[2]);
      $dot = '';
        if (!preg_match('/[\/a-zA-Z\d]/', $addr{$le - 1})) {
            $dot = $addr{$le - 1};
      if (isset($addr[$le - 1]) && !preg_match('/[\/a-zA-Z\d]/', $addr[$le - 1])) {
        $dot = $addr[$le - 1];
        $addr = substr($addr, 0, $le - 1);
      }
      if (strpos($addr, 'your-drupal-site.tld/') === 0) {