Share Phpcms V9 Change domain name, attachment address can not be batch update (change the change) problem > Solution!!

Source: Internet
Author: User
Tags change domain name

Everyone should have the content > Attachment management > Attachment address substitution feature in case of domain change (for example, from local upload to space).
Basically, you can't replace the address of the original domain name in all the tables.
Now Phpcms V9 The latest version of the problem still exists.

Find cause Discovery phpcms\modules\attachment\address.php Update () (latest version LINE35) has a problem with the following code:
if (Preg_match ('/(Char|text|mediumtex) +/i ', $val)) {
The sentence is judged for all the field types in all tables. If this is Char|text|mediumtex three types of fields, Executes the contents of the corresponding field. Otherwise, it is not replaced. The URL field type of most attachments in the table is a varchar type. Therefore, most of the attachment URLs are not replaced.

Correction Method:

Replace the line with: if (Preg_match ('/(char|text|mediumtex| VARCHAR) +/i ', $val)) {

This article transferred from: http://bbs.phpcms.cn/thread-724119-1-1.html

Share Phpcms V9 Change domain name, attachment address can not be batch update (change the change) problem > Solution!!

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.