blob: 9dcbff86ccaae979a519c6733162c65d13585165 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
|
# -*- coding: utf8 -*-
#
# Copyright (C) 2014 Evol Online
# Author: Andrei Karas (4144)
def stripQuotes(data):
if len(data) == 0:
return data
if data[-1] == "\"":
data = data[:-1]
if data[0] == "\"":
data = data[1:]
if data[-1] == "'":
data = data[:-1]
if data[0] == "'":
data = data[1:]
return data
def stripQuotes2(data):
for idx in xrange(0, len(data)):
data[idx] = stripQuotes(data[idx])
return data
def strToXml(data):
data = data.replace("&", "&");
data = data.replace("<", "<");
data = data.replace(">", ">");
return data
def stripNewLine(data):
if len(data) == 0:
return data
if data[-1] == "\n":
data = data[:-1]
return data
def escapeSqlStr(data):
data = data.replace("\\", "\\\\");
data = data.replace("'", "\\'");
data = data.replace("`", "\\`");
data = data.replace("{", "\\{");
data = data.replace("}", "\\}");
return data
def removeGat(data):
if len(data) >= 4 and data[-4:] == ".gat":
data = data[:-4]
return data
|