[Openupload-svn-update] SF.net SVN: openupload:[383] branches/v0.4
Status: Beta
Brought to you by:
tsdogs
|
From: <ts...@us...> - 2010-11-18 20:32:57
|
Revision: 383
http://openupload.svn.sourceforge.net/openupload/?rev=383&view=rev
Author: tsdogs
Date: 2010-11-18 20:32:51 +0000 (Thu, 18 Nov 2010)
Log Message:
-----------
escape the fields to prevent scripting attaks
Modified Paths:
--------------
branches/v0.4/lib/main.inc.php
branches/v0.4/lib/modules/default/auth.inc.php
branches/v0.4/lib/modules/default/files.inc.php
branches/v0.4/plugins/email.inc.php
branches/v0.4/templates/default/modules/admin/logs.tpl
Modified: branches/v0.4/lib/main.inc.php
===================================================================
--- branches/v0.4/lib/main.inc.php 2010-03-24 16:41:36 UTC (rev 382)
+++ branches/v0.4/lib/main.inc.php 2010-11-18 20:32:51 UTC (rev 383)
@@ -71,8 +71,8 @@
/* check if it was forced */
if (isset($_GET['lang'])) {
$user = $this->user->info();
- $user['lang']=$_GET['lang'];
- $this->user->setInfo('lang',$_GET['lang']);
+ $user['lang']=htmlentities($_GET['lang']);
+ $this->user->setInfo('lang',htmlentities($_GET['lang']));
}
/* configure the language */
@@ -176,9 +176,14 @@
if (isset($this->config['logging'])) {
if ($this->config['logging']['enabled']=='yes') {
$ip = $_SERVER['REMOTE_ADDR'];
- $login = $this->user->info('login');
- $module = $this->actions[$this->action];
- $action = $this->action;
+ $login = htmlentities($this->user->info('login'));
+ $module = $this->actions[htmlentities($this->action)];
+ $action = htmlentities($this->action);
+ $ip = htmlentities($ip);
+ $realaction = htmlentities($realaction);
+ $plugin = htmlentities($plugin);
+ $result = htmlentities($result);
+ $moreinfo = htmlentities($moreinfo);
if ($this->config['logging']['db_level']>=$this->loglevels[$level]['id']) {
if (is_object($this->db)) {
$this->db->insert('activitylog',
@@ -191,7 +196,7 @@
'realaction' => $realaction,
'plugin' => $plugin,
'result' => $result,
- 'moreinfo' => $moreinfo
+ 'moreinfo' => $moreinfo
) );
}
}
Modified: branches/v0.4/lib/modules/default/auth.inc.php
===================================================================
--- branches/v0.4/lib/modules/default/auth.inc.php 2010-03-24 16:41:36 UTC (rev 382)
+++ branches/v0.4/lib/modules/default/auth.inc.php 2010-11-18 20:32:51 UTC (rev 383)
@@ -149,10 +149,10 @@
$failed = true;
}
$user['login'] = $_POST['registerlogin'];
- $user['name'] = $_POST['registername'];
+ $user['name'] = htmlentities($_POST['registername']);
$user['password'] = $_POST['registerpassword'];
$user['email'] = $_POST['registeremail'];
- $user['lang'] = $_POST['registerlang'];
+ $user['lang'] = htmlentities($_POST['registerlang']);
$user['group_name'] = app()->config['register']['default_group'];
$user['reg_date']=date('Y-m-d H:i:s');
$result = app()->pluginAction('registerConfirm',$user);
@@ -274,4 +274,4 @@
$this->tpl->assign('puser',$user);
}
}
-?>
\ No newline at end of file
+?>
Modified: branches/v0.4/lib/modules/default/files.inc.php
===================================================================
--- branches/v0.4/lib/modules/default/files.inc.php 2010-03-24 16:41:36 UTC (rev 382)
+++ branches/v0.4/lib/modules/default/files.inc.php 2010-11-18 20:32:51 UTC (rev 383)
@@ -212,7 +212,7 @@
$this->prevStep();
for ($i = 0; $i<count($_SESSION['user']['u']); $i++) {
$finfo = $_SESSION['user']['u'][$i];
- $finfo['description'] = $_POST['description'];
+ $finfo['description'] = htmlentities($_POST['description']);
if ($i==0) {
$s = isset(app()->config['id_max_length'])?app()->config['id_max_length']:30;
$a = isset(app()->config['id_use_alpha'])?app()->config['id_use_alpha']=='yes':false;
@@ -562,4 +562,4 @@
}
}
-?>
\ No newline at end of file
+?>
Modified: branches/v0.4/plugins/email.inc.php
===================================================================
--- branches/v0.4/plugins/email.inc.php 2010-03-24 16:41:36 UTC (rev 382)
+++ branches/v0.4/plugins/email.inc.php 2010-11-18 20:32:51 UTC (rev 383)
@@ -26,8 +26,8 @@
$finfo[0]['emailfrom']=app()->config['site']['email'];
$finfo[0]['emailto']=$_POST['emailto'];
$finfo[0]['email_removelink']=$_POST['removelink'];
- $finfo[0]['subject']=$_POST['subject'];
- $finfo[0]['message']=$_POST['message'];
+ $finfo[0]['subject']=htmlentities($_POST['subject']);
+ $finfo[0]['message']=htmlentities($_POST['message']);
// TODO: Fix this mess with the e-mail sender
if ($_SESSION['user']['email']=='') {
if ($finfo[0]['emailme']=="yes") {
Modified: branches/v0.4/templates/default/modules/admin/logs.tpl
===================================================================
--- branches/v0.4/templates/default/modules/admin/logs.tpl 2010-03-24 16:41:36 UTC (rev 382)
+++ branches/v0.4/templates/default/modules/admin/logs.tpl 2010-11-18 20:32:51 UTC (rev 383)
@@ -49,7 +49,7 @@
<td id="{$rid}">{$l.realaction}</td>
<td id="{$rid}">{$l.plugin}</td>
<td id="{$rid}">{$l.result}</td>
- <td id="{$rid}">{$l.additional}</td>
+ <td id="{$rid}">{$l.moreinfo}</td>
</tr>
{/foreach}
-</table>
\ No newline at end of file
+</table>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|