thinkphp 3.2.2 Rewrite bug, fix method

Source: Internet
Author: User

tp3.2.x problem really many, the official website is not maintenance, many times TP official website can not download TP at all.

A very serious bug, URL rewrite can not support the reason thinkphp originally executed in the order of all the wrong!


Workaround:

File:

#D: \pc\zbphp.com\thinkphp\library\think\dispatcher.class.php


Code: (Replace with the following can by Default7#zbphp.com)

        if (Empty ($_server[' path_info ')) {$_server[' path_info '] = ';            Define (' __info__ ', ');        Define (' __ext__ ', '); }else{Route::check ();//add by default7#zbphp.com define (' __info__ ', trim ($_server[' path_info '), '/')            );            URL suffix define (' __ext__ ', Strtolower (PathInfo ($_server[' path_info '],pathinfo_extension)));                 $_server[' path_info '] = __info__;                if (__info__ &&!defined (' bind_module ') && C (' multi_module ') && empty ($_get)) {//Get module name                $paths = Explode ($depr, __info__,2); $allowList = C (' module_allow_list '); List of allowed modules $module = preg_replace ('/\. '. __ext__.                ' $/i ', ', $paths [0]; if (Empty ($allowList) | | (Is_array ($allowList) && in_array_case ($module, $allowList)))                    {$_get[$varModule] = $module; $_server[' path_info ' = Isset ($patHs[1])? $paths [1]: '; }            }                           }


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.