Dotclear

Changeset 3395:445e9ff79a1f


Ignore:
Timestamp:
11/08/16 11:56:54 (9 years ago)
Author:
franck <carnet.franck.paul@…>
Branch:
default
Message:

Capture output buffer during module’s file loading, addresses #2214

File:
1 edited

Legend:

Unmodified
Added
Removed
  • inc/core/class.dc.modules.php

    r3333 r3395  
    193193                              $this->id = $entry; 
    194194                              $this->mroot = $full_entry; 
     195                              ob_start(); 
    195196                              require $full_entry.'/_define.php'; 
     197                              ob_end_clean(); 
    196198                              $this->all_modules[$entry] =& $this->modules[$entry]; 
    197199                              $this->id = null; 
     
    203205                                   $this->id = $entry; 
    204206                                   $this->mroot = $full_entry; 
    205                                    $this->disabled_mode=true; 
     207                                   $this->disabled_mode = true; 
     208                                   ob_start(); 
    206209                                   require $full_entry.'/_define.php'; 
    207                                    $this->disabled_mode=false; 
     210                                   ob_end_clean(); 
     211                                   $this->disabled_mode = false; 
    208212                                   $this->disabled[$entry] =  $this->disabled_meta; 
    209213                                   $this->all_modules[$entry] =& $this->disabled[$entry]; 
     
    260264          if (file_exists($dir.'/_define.php')) { 
    261265               $this->id = $id; 
     266               ob_start(); 
    262267               require $dir.'/_define.php'; 
     268               ob_end_clean(); 
    263269               $this->id = null; 
    264270          } 
     
    722728     } 
    723729 
    724      protected function loadModuleFile($________) 
     730     protected function loadModuleFile($________,$catch = true) 
    725731     { 
    726732          if (!file_exists($________)) { 
     
    736742          } 
    737743 
     744          if ($catch) { 
     745               // Catch ouput to prevents hacked or corrupted modules 
     746               ob_start(); 
     747               $ret = require $________; 
     748               ob_end_clean(); 
     749               return $ret; 
     750          } 
     751 
    738752          return require $________; 
    739753     } 
Note: See TracChangeset for help on using the changeset viewer.

Sites map