Hack để cài đặt Drupal trên server với register_global = ON

Bạn không thể cài đặt Drupal nếu như server thiết lập tính năng register_globals thành ON. Năn nỉ hoài mà quản lý server không chịu cấu hình lại server => Đành phải hack code.

Mở file /modules/system/system.install, tìm hàm system_requirements(), tìm dòng:

<?php
  
if (!empty($register_globals) && strtolower($register_globals) !=
'off') {
?>

Sửa thành:

<?php
  
if (
    
false // toila.net's HACK: !empty($register_globals) &&
strtolower($register_globals) != 'off'
  
) {
?>

Sử dụng hack này cực kỳ rủi ro nhé, google thử sẽ ra
một vài thí dụ.

:-)

Thế Hồng

Comments

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <sup> <br> <p> <h3>
  • Lines and paragraphs break automatically.
  • Link to content with [[some text]], where "some text" is the title of existing content or the title of a new piece of content to create. You can also link text to a different title by using [[link to this title|show this text]]. Link to outside URLs with [[http://www.example.com|some text]], or even [[http://www.example.com]].
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>. Beside the tag style "<foo>" it is also possible to use "[foo]". PHP source code can also be enclosed in <?php ... ?> or <% ... %>.

More information about formatting options

CAPTCHA
This question is used to make sure you are a human visitor and to prevent spam submissions.
Image CAPTCHA
Copy the characters (respecting upper/lower case) from the image.