Join 34,000+ subscribers and receive articles from our blog about software quality, testing, QA and security.
 

Solved: Preg_replace(): The /e modifier is no longer supported


#1

Hi,

I just started using Testrail. One of my users reported an issue with emailing a report:

preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead

I found the line responsible. I was in Headers.php:

$encoded_value[$key] = preg_replace("/<([^>]+)>/e", $cb, $encoded_value[$key]);

I tried changing it but with now successes. Any help would be appreciated.

Solution:

$encoded_value[$key] = preg_replace_callback("/<([^>]+)>/", function($match) { return $cb; }, $encoded_value[$key]);


#2

where is headers.php file located?

found one here -> /var/www/html/testrail/app/views/report_plugins/tests/grid

but headers.php is encoded:
“<?php //000a4
echo(‘ionCube loader not installed. Please contact us at contact@gurock.com (’ . FILE . ‘).’ );exit(199);
?>
HR+cPpkJAwm8PP23rIc+Zz8QaQddZ4mksipIJR6uMLinuSnpTmIQVfqSb2G1gmu/zeIS9NXYJ2j/
ugE7LLFsXv60CeLMt3IsLPnaCSZne09tJSmovW+iLA+W0UsPh/bJidyaFIWc+qQ1qk2gpEL8kSn5
RNbhbA31V9B/9UWjrwhsarRTV5XiNqknBrAu8Bybxfd8lOiizWM+ax5s18RClpyrNxEBY4IvmxQp
wBDc3UZP0NfpzOl0nFgcNQCH9xKJL1ZmaKDfI8Sz902CT7OPd2dF6I+m5nbf3AnQqV1aaK6v5cdw
vR5i/x2YvMfjRNCiT6Qj/izW+KIeu6NqkzoNEkU57gPGf8N0GlQNDaGpfO2fDkf0tVrSXdE9P+Dm
eS3LO8gAN7+Q787nl+vZUPZStFUYVMdaUn2TSR8TJxYFqK9n4OA93FzjXkeP5VgzM6YJPHWzSyEU…”