[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpgroupware-cvs] calendar/inc class.socalendar.inc.php class.soc... [V
From: |
Dave Hall |
Subject: |
[Phpgroupware-cvs] calendar/inc class.socalendar.inc.php class.soc... [Version-0_9_16-branch] |
Date: |
Mon, 24 Apr 2006 14:16:19 +0000 |
CVSROOT: /sources/phpgroupware
Module name: calendar
Branch: Version-0_9_16-branch
Changes by: Dave Hall <address@hidden> 06/04/24 14:16:19
Modified files:
inc : class.socalendar.inc.php
class.socalendar_sql.inc.php
class.soholiday.inc.php
Log message:
clean up a little
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/calendar/inc/class.socalendar.inc.php.diff?only_with_tag=Version-0_9_16-branch&tr1=1.22.2.5.2.6&tr2=1.22.2.5.2.7&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/calendar/inc/class.socalendar_sql.inc.php.diff?only_with_tag=Version-0_9_16-branch&tr1=1.28.2.4.2.11&tr2=1.28.2.4.2.12&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/calendar/inc/class.soholiday.inc.php.diff?only_with_tag=Version-0_9_16-branch&tr1=1.2.2.2.2.1&tr2=1.2.2.2.2.2&r1=text&r2=text
Patches:
Index: calendar/inc/class.socalendar.inc.php
diff -u calendar/inc/class.socalendar.inc.php:1.22.2.5.2.6
calendar/inc/class.socalendar.inc.php:1.22.2.5.2.7
--- calendar/inc/class.socalendar.inc.php:1.22.2.5.2.6 Thu Jul 15 00:31:38 2004
+++ calendar/inc/class.socalendar.inc.php Mon Apr 24 14:16:19 2006
@@ -12,7 +12,7 @@
* option) any later version. *
\**************************************************************************/
- /* $Id: class.socalendar.inc.php,v 1.22.2.5.2.6 2004/07/15 00:31:38 skwashd
Exp $ */
+ /* $Id: class.socalendar.inc.php,v 1.22.2.5.2.7 2006/04/24 14:16:19 skwashd
Exp $ */
class socalendar
{
@@ -145,14 +145,15 @@
$sql = 'AND (phpgw_cal_user.cal_login IN
('.implode(',',$members).')) AND '.
'(phpgw_cal_user.cal_login='.intval($this->owner).' OR phpgw_cal.is_public=1)
AND (';
- $words = split(' ',$keywords);
+ $words = explode(' ', $keywords);
foreach($words as $i => $word)
{
+ $word = $this->db->db_addslashes(trim($word));
$sql .= $i > 0 ? ' OR ' : '';
- $sql .= "(UPPER(phpgw_cal.title) LIKE
UPPER('%".addslashes($word)."%') OR "
- . "UPPER(phpgw_cal.description)
LIKE UPPER('%".addslashes($word)."%') OR "
- . "UPPER(phpgw_cal.location)
LIKE UPPER('%".addslashes($word)."%') OR "
- .
"UPPER(phpgw_cal_extra.cal_extra_value) LIKE UPPER('%".addslashes($word)."%'))";
+ $sql .= "(UPPER(phpgw_cal.title) LIKE
UPPER('%$word%') OR "
+ . "UPPER(phpgw_cal.description)
LIKE UPPER('%$word%') OR "
+ . "UPPER(phpgw_cal.location)
LIKE UPPER('%$word%') OR "
+ .
"UPPER(phpgw_cal_extra.cal_extra_value) LIKE UPPER('%$word%'))";
}
$sql .= ') ';
@@ -160,7 +161,7 @@
$sql .= ($this->cat_id? "AND
(phpgw_cal.category='$this->cat_id' OR phpgw_cal.category like
'%,".$this->cat_id.",%') ":'');
$sql .= 'ORDER BY phpgw_cal.datetime DESC,
phpgw_cal.edatetime DESC, phpgw_cal.priority ASC';
- return $this->get_event_ids(False,$sql,True);
+ return $this->get_event_ids(false, $sql, true);
}
function
read_from_store($startYear,$startMonth,$startDay,$endYear='',$endMonth='',$endDay='')
@@ -228,8 +229,11 @@
$this->cal->delete_calendar($owner);
}
- function change_owner($account_id,$new_owner)
+ function change_owner($account_id, $new_owner)
{
+ $account_id = (int)$account_id;
+ $new_owner = (int)$new_owner;
+
if($GLOBALS['phpgw_info']['server']['calendar_type'] ==
'sql')
{
$db2 = $this->cal->stream;
@@ -286,6 +290,7 @@
function find_recur_exceptions($event_id)
{
+ $event_id = (int)$event_id;
if($GLOBALS['phpgw_info']['server']['calendar_type'] ==
'sql')
{
$arr = Array();
Index: calendar/inc/class.socalendar_sql.inc.php
diff -u calendar/inc/class.socalendar_sql.inc.php:1.28.2.4.2.11
calendar/inc/class.socalendar_sql.inc.php:1.28.2.4.2.12
--- calendar/inc/class.socalendar_sql.inc.php:1.28.2.4.2.11 Sat Nov 6
16:13:42 2004
+++ calendar/inc/class.socalendar_sql.inc.php Mon Apr 24 14:16:19 2006
@@ -12,7 +12,7 @@
* option) any later version. *
\**************************************************************************/
- /* $Id: class.socalendar_sql.inc.php,v 1.28.2.4.2.11 2004/11/06 16:13:42
powerstat Exp $ */
+ /* $Id: class.socalendar_sql.inc.php,v 1.28.2.4.2.12 2006/04/24 14:16:19
skwashd Exp $ */
if (@$GLOBALS['phpgw_info']['flags']['included_classes']['socalendar_'])
{
@@ -211,10 +211,10 @@
{
if(!isset($this->stream))
{
- return False;
+ return false;
}
- $event_id = intval($event_id);
+ $event_id = (int)$event_id;
$this->stream->lock(array('phpgw_cal','phpgw_cal_user','phpgw_cal_repeats','phpgw_cal_extra'/*
OLD-ALARM,'phpgw_cal_alarm'*/));
@@ -363,7 +363,7 @@
}
else
{
- $this->event = False;
+ $this->event = false;
}
$this->stream->unlock();
Index: calendar/inc/class.soholiday.inc.php
diff -u calendar/inc/class.soholiday.inc.php:1.2.2.2.2.1
calendar/inc/class.soholiday.inc.php:1.2.2.2.2.2
--- calendar/inc/class.soholiday.inc.php:1.2.2.2.2.1 Sat Nov 6 16:13:42 2004
+++ calendar/inc/class.soholiday.inc.php Mon Apr 24 14:16:19 2006
@@ -10,7 +10,7 @@
* option) any later version. *
\**************************************************************************/
- /* $Id: class.soholiday.inc.php,v 1.2.2.2.2.1 2004/11/06 16:13:42
powerstat Exp $ */
+ /* $Id: class.soholiday.inc.php,v 1.2.2.2.2.2 2006/04/24 14:16:19
skwashd Exp $ */
class soholiday
{
@@ -116,7 +116,7 @@
if(is_string($locales))
{
- $find = "'".$locales."'";
+ $find = "'" .
$this->db->db_addslashes($locales) . "'";
}
elseif(is_array($locales))
{
@@ -127,14 +127,14 @@
{
$find .= ',';
}
- $find .= "'".$value."'";
+ $find .= "'" .
$this->db->db_addslashes($value) . "'";
}
}
$querymethod = '';
if($query)
{
- $querymethod = " AND name like '%".$query."%'";
+ $querymethod = " AND name like '%" .
$this->db->db_addslashes($query) . "%'";
}
if (intval($year) > 1900)
{
@@ -150,7 +150,7 @@
$querymethod = '';
if($query)
{
- $querymethod .= " WHERE locale like
'%".$query."%'";
+ $querymethod .= " WHERE locale like '%" .
$this->db->db_addslashes($query) . "%'";
}
if($order)
@@ -176,7 +176,7 @@
{
$querymethod .= " AND (occurence < 1900 OR
occurence = $year)";
}
- $sql = "SELECT count(*) FROM phpgw_cal_holidays WHERE
locale='".$locale."'".$querymethod;
+ $sql = "SELECT count(*) FROM phpgw_cal_holidays WHERE
locale='" . $this->db->db_addslashes($locale) . "'".$querymethod;
if($this->debug)
{
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Phpgroupware-cvs] calendar/inc class.socalendar.inc.php class.soc... [Version-0_9_16-branch],
Dave Hall <=