~ubuntu-branches/debian/stretch/cacti/stretch

« back to all changes in this revision

Viewing changes to lib/adodb/drivers/adodb-vfp.inc.php

  • Committer: Package Import Robot
  • Author(s): Paul Gevers
  • Date: 2015-06-22 19:59:13 UTC
  • mfrom: (1.1.16) (36.1.2 experimental)
  • Revision ID: package-import@ubuntu.com-20150622195913-40twdt0k4ondnuvz
Tags: 0.8.8d+ds1-1
* Upload to unstable
* New upstream release
  - CVE-2015-2665 Cross-site scripting (XSS) vulnerability in Cacti
    before 0.8.8d allows remote attackers to inject arbitrary web script
    or HTML via unspecified vectors.
  - CVE-2015-4342 SQL Injection and Location header injection from cdef id
  - CVE-2015-4454 SQL injection vulnerability in the
    get_hash_graph_template function in lib/functions.php in Cacti before
    0.8.8d allows remote attackers to execute arbitrary SQL commands via
    the graph_template_id parameter to graph_templates.php.
  - Unassigned CVE VN:JVN#78187936 / TN:JPCERT#98968540 Fixed SQL injection
* Remove Sean from the list of uploaders. Thanks for all the fish
  (Closes: #773436)
* Fix d/p/07_cli-include-path.patch (LP: #1433665)
* Update debian/patches/fix_php_strict_warning_in_ping.patch for partial
  upstream fix
* Include the virtual alternative for the recommends on mysql-server
  (Closes: #781982)
* Upstream dropped unused javascripts, remove them from d/copyright
* Add patch to have upgrade script mention version 0.8.8d i.s.o. 0.8.8c

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
<?php
2
 
/* 
3
 
V4.54 5 Nov 2004  (c) 2000-2004 John Lim (jlim@natsoft.com.my). All rights reserved.
4
 
  Released under both BSD license and Lesser GPL library license. 
5
 
  Whenever there is any discrepancy between the two licenses, 
6
 
  the BSD license will take precedence. 
7
 
Set tabs to 4 for best viewing.
8
 
  
9
 
  Latest version is available at http://adodb.sourceforge.net
10
 
  
11
 
  Microsoft Visual FoxPro data driver. Requires ODBC. Works only on MS Windows.
12
 
*/
13
 
 
14
 
// security - hide paths
15
 
if (!defined('ADODB_DIR')) die();
16
 
 
17
 
if (!defined('_ADODB_ODBC_LAYER')) {
18
 
        include(ADODB_DIR."/drivers/adodb-odbc.inc.php");
19
 
}
20
 
if (!defined('ADODB_VFP')){
21
 
define('ADODB_VFP',1);
22
 
class ADODB_vfp extends ADODB_odbc {
23
 
        var $databaseType = "vfp";      
24
 
        var $fmtDate = "{^Y-m-d}";
25
 
        var $fmtTimeStamp = "{^Y-m-d, h:i:sA}";
26
 
        var $replaceQuote = "'+chr(39)+'" ;
27
 
        var $true = '.T.';
28
 
        var $false = '.F.';
29
 
        var $hasTop = 'top';            // support mssql SELECT TOP 10 * FROM TABLE
30
 
        var $_bindInputArray = false; // strangely enough, setting to true does not work reliably
31
 
        var $sysTimeStamp = 'datetime()';
32
 
        var $sysDate = 'date()';
33
 
        var $ansiOuter = true;
34
 
        var $hasTransactions = false;
35
 
        var $curmode = false ; // See sqlext.h, SQL_CUR_DEFAULT == SQL_CUR_USE_DRIVER == 2L
36
 
        
37
 
        function ADODB_vfp()
38
 
        {
39
 
                $this->ADODB_odbc();
40
 
        }
41
 
        
42
 
        function Time()
43
 
        {
44
 
                return time();
45
 
        }
46
 
        
47
 
        function BeginTrans() { return false;}
48
 
        
49
 
        // quote string to be sent back to database
50
 
        function qstr($s,$nofixquotes=false)
51
 
        {
52
 
                if (!$nofixquotes) return  "'".str_replace("\r\n","'+chr(13)+'",str_replace("'",$this->replaceQuote,$s))."'";
53
 
                return "'".$s."'";
54
 
        }
55
 
 
56
 
        
57
 
        // TOP requires ORDER BY for VFP
58
 
        function &SelectLimit($sql,$nrows=-1,$offset=-1, $inputarr=false,$secs2cache=0)
59
 
        {
60
 
                $this->hasTop = preg_match('/ORDER[ \t\r\n]+BY/is',$sql) ? 'top' : false;
61
 
                return ADOConnection::SelectLimit($sql,$nrows,$offset,$inputarr,$secs2cache);
62
 
        }
63
 
        
64
 
 
65
 
 
66
 
};
67
 
 
68
 
 
69
 
class  ADORecordSet_vfp extends ADORecordSet_odbc {     
70
 
        
71
 
        var $databaseType = "vfp";              
72
 
 
73
 
        
74
 
        function ADORecordSet_vfp($id,$mode=false)
75
 
        {
76
 
                return $this->ADORecordSet_odbc($id,$mode);
77
 
        }
78
 
 
79
 
        function MetaType($t,$len=-1)
80
 
        {
81
 
                if (is_object($t)) {
82
 
                        $fieldobj = $t;
83
 
                        $t = $fieldobj->type;
84
 
                        $len = $fieldobj->max_length;
85
 
                }
86
 
                switch (strtoupper($t)) {
87
 
                case 'C':
88
 
                        if ($len <= $this->blobSize) return 'C';
89
 
                case 'M':
90
 
                        return 'X';
91
 
                         
92
 
                case 'D': return 'D';
93
 
                
94
 
                case 'T': return 'T';
95
 
                
96
 
                case 'L': return 'L';
97
 
                
98
 
                case 'I': return 'I';
99
 
                
100
 
                default: return 'N';
101
 
                }
102
 
        }
103
 
}
104
 
 
105
 
} //define
106
 
?>