Preg_replace function in PHP5.2

Source: Internet
Author: User

Preg_replace function in PHP5.2

This article mainly introduces the preg_replace function in PHP5.2. For more information, see

Preg_replace uses more than the default allowed bytes in php5.2, that is, the size of pcre. backtrack_limit and pcre. recursion_limit.

Discuz! Since the release of the official version 6.0.0 program, everyone has been upgrading, but some plug-ins have encountered problems under section 6.0.

Like http://www.discuz.net/viewthread.php? Tid = 559133 this banking plug-in

White screen problems may occur after installation in php 5.2.0 or later environments.

From Discuz! From the user's perspective, we need to help the plug-in author solve this problem.

Let's talk about my solution process. I hope I can give you some suggestions.

First, this plug-in can run normally in the case of 5.5, but it will be white screen in the case of 6.0

Discuz! 6.0 in order to increase the readability of the template cache file and the indent of the cache file, the template Processing Section of templates. func. php has been modified,

Why? At first, I initially confirmed that this was the problem. Because I replaced the modified Code with part of the code in 5.5, it was normal, but I was very depressed and did not find the cause.

Step 2: I am skeptical about the bank.htm template writing format, so I am very depressed to start analyzing the template. To be honest, it is really a headache to analyze the template. The cause is obviously not found. Relatively depressing

Step 2: After the template is split, it will be executed normally. At this time, I initially suspect that the bug of Regular Expression matching has encountered an error in the case of large data volumes, so I went to bugs.php.net and started searching for the http://bugs.php.net/search.php? C... Ace & x = 3 & y = 5 here to find ah find, so finally found here http://bugs.php.net/bug.php? Id = 39405, suddenly found that the problem is 5.2 configuration, after adjusting the large pcre. backtrack_limit and pcre. recursion_limit, the problem is solved

It is said that pcre. backtrack_limit =-1 in php. ini

Is not limited

The reason for writing this details is to share my ideas for solving the problem together :)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.