[Openupload-svn-update] SF.net SVN: openupload:[214] trunk/lib
Status: Beta
Brought to you by:
tsdogs
|
From: <ts...@us...> - 2008-12-29 10:53:22
|
Revision: 214
http://openupload.svn.sourceforge.net/openupload/?rev=214&view=rev
Author: tsdogs
Date: 2008-12-29 10:53:18 +0000 (Mon, 29 Dec 2008)
Log Message:
-----------
security fix on windows
a couple of additional config options to better support smarty configurations
Modified Paths:
--------------
trunk/lib/general.inc.php
trunk/lib/main.inc.php
Modified: trunk/lib/general.inc.php
===================================================================
--- trunk/lib/general.inc.php 2008-12-29 09:54:56 UTC (rev 213)
+++ trunk/lib/general.inc.php 2008-12-29 10:53:18 UTC (rev 214)
@@ -4,7 +4,10 @@
ob_start();
session_start();
-define('SMARTY_DIR', $CONFIG['INSTALL_ROOT'].'/lib/smarty/');
+if (isset($CONFIG['SMARTY_DIR']))
+ define('SMARTY_DIR', $CONFIG['SMARTY_DIR']);
+else
+ define('SMARTY_DIR', $CONFIG['INSTALL_ROOT'].'/lib/smarty/');
require(SMARTY_DIR . 'Smarty.class.php');
require_once($CONFIG['INSTALL_ROOT'].'/lib/classes.inc.php');
require_once($CONFIG['INSTALL_ROOT'].'/lib/user.inc.php');
@@ -117,7 +120,7 @@
-- Support on Windows PHP for the function 'checkdnsrr'
used within the 'validEmail' function has been added.
-- Pending further investigation.
- -- Discovery/Solution thanks to: Korn\x8El
+ -- Discovery/Solution thanks to: Korn�l
-- http://hu.php.net/manual/en/function.checkdnsrr.php#75158
*/
function validEmail($email){
@@ -129,7 +132,7 @@
if($recType == ''){
$recType = "MX";
}
- exec("nslookup -type=$recType $hostName", $result);
+ exec("nslookup -type=$recType ".escapeshellcmd($hostName), $result);
// check each line to find the one that starts with the host
// name. If it exists then the function succeeded.
foreach ($result as $line) {
Modified: trunk/lib/main.inc.php
===================================================================
--- trunk/lib/main.inc.php 2008-12-29 09:54:56 UTC (rev 213)
+++ trunk/lib/main.inc.php 2008-12-29 10:53:18 UTC (rev 214)
@@ -22,9 +22,14 @@
/* initialize template engine */
$this->tpl = new Smarty();
$this->tpl->template_dir = $this->config['INSTALL_ROOT'].'/templates';
- $this->tpl->compile_dir = $this->config['INSTALL_ROOT'].'/templates_c/';
- $this->tpl->config_dir = SMARTY_DIR.'/config';
- $this->tpl->cache_dir = $this->config['INSTALL_ROOT'].'/cache';
+ if (isset($this->config['SMARTY_DATA'])) {
+ $this->tpl->compile_dir = $this->config['SMARTY_DATA'].'/templates_c/';
+ $this->tpl->cache_dir = $this->config['SMARTY_DATA'].'/cache';
+ } else {
+ $this->tpl->compile_dir = $this->config['INSTALL_ROOT'].'/templates_c/';
+ $this->tpl->cache_dir = $this->config['INSTALL_ROOT'].'/cache';
+ }
+ $this->tpl->config_dir = SMARTY_DIR.'/configs';
$this->tpl->caching = $this->config['site']['caching'];
$this->page['template']= $this->config['WWW_ROOT'].'/templates/'.$this->config['site']['template'];
@@ -53,7 +58,7 @@
if (isset($this->config['translator'])) {
$trname = $this->config['translator'];
} else {
- $trname = 'gettext';
+ $trname = 'null';
}
require_once($this->config['INSTALL_ROOT'].'/lib/modules/tr/'.$trname.'.inc.php');
$tr = $trname.'Translator';
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|