Ignore:
Timestamp:
Sep 4, 2008, 3:28:34 AM (16 years ago)
Author:
rvelices
Message:
  • bug 854: better checks of directory creations ( local_data_dir, templates_c, tmp etc...)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/template.class.php

    r2489 r2497  
    5454    $this->smarty->debugging = $conf['debug_template'];
    5555
    56     if ( isset($conf['compiled_template_dir'] ) )
    57     {
    58       $compile_dir = $conf['compiled_template_dir'];
    59     }
    60     else
    61     {
    62       $compile_dir = $conf['local_data_dir'];
    63       if ( !is_dir($compile_dir) )
    64       {
    65         mkdir( $compile_dir, 0777);
    66         file_put_contents($compile_dir.'/index.htm', '');
    67       }
    68       $compile_dir .= '/templates_c';
    69     }
    70     if ( !is_dir($compile_dir) )
    71     {
    72       mkdir( $compile_dir, 0777 );
    73       file_put_contents($compile_dir.'/index.htm', '');
    74     }
     56    $compile_dir = $conf['local_data_dir'].'/templates_c';
     57    mkgetdir( $compile_dir );
    7558
    7659    $this->smarty->compile_dir = $compile_dir;
     
    124107      $this->smarty->clear_compiled_tpl();
    125108      $this->smarty->compile_id = $save_compile_id;
    126       file_put_contents($this->smarty->compile_dir.'/index.htm', '');
     109      file_put_contents($this->smarty->compile_dir.'/index.htm', 'Not allowed!');
    127110  }
    128111
Note: See TracChangeset for help on using the changeset viewer.