root/releases/0.673/lib/constants.php

Revision 269, 5.1 kB (checked in by ben, 3 years ago)

--

  • Property svn:eol-style set to native
Line 
1 <?php
2
3 // define all the constants and other global vars that are used by elgglib.
4
5 /// Parameter constants - if set then the parameter is cleaned of scripts etc. ///
6 /**
7  * PARAM_RAW specifies a parameter that should contain:
8  */
9 define('PARAM_RAW',      0x0000);
10
11 /**
12  * PARAM_CLEAN specifies a parameter that should contain:
13  */
14 define('PARAM_CLEAN',    0x0001);
15
16 /**
17  * PARAM_INT  specifies a parameter that should contain an integer value only.
18  */
19 define('PARAM_INT',      0x0002);
20
21 /**
22  * PARAM_INTEGER - an alias for PARAM_INT
23  */
24 define('PARAM_INTEGER'0x0002);
25
26 /**
27  * PARAM_ALPHA  specifies a parameter that should contain a string type (?).
28  */
29 define('PARAM_ALPHA',    0x0004);
30
31 /**
32  * PARAM_ACTION - an alias for PARAM_ALPHA
33  */
34 define('PARAM_ACTION',   0x0004);
35
36 /**
37  * PARAM_FORMAT - an alias for PARAM_ALPHA
38  */
39 define('PARAM_FORMAT',   0x0004);
40
41 /**
42  * PARAM_NOTAGS specifies a parameter that should contain:
43  */
44 define('PARAM_NOTAGS',   0x0008);
45
46 /**
47  * PARAM_FILE specifies a parameter that should contain:
48  */
49 define('PARAM_FILE',     0x0010);
50
51 /**
52  * PARAM_PATH specifies a parameter that should contain:
53  */
54 define('PARAM_PATH',     0x0020);
55
56 /**
57  * PARAM_HOST specifies a parameter that should contain a fully qualified domain name (FQDN) or an IPv4 dotted quad (IP address)
58  */
59 define('PARAM_HOST',     0x0040);
60
61 /**
62  * PARAM_URL specifies a parameter that should contain a string in the form of a properly formatted URL.
63  */
64 define('PARAM_URL',      0x0080);
65
66 /**
67  * PARAM_LOCALURL specifies a parameter that should contain a string in the form of a properly formatted URL as well as one that refers to the local server itself. (NOT orthogonal to the others! Implies PARAM_URL!)
68  */
69 define('PARAM_LOCALURL', 0x0180);
70
71 /**
72  * PARAM_CLEANFILE specifies a parameter that should contain:
73  */
74 define('PARAM_CLEANFILE',0x0200);
75
76 /**
77  * PARAM_ALPHANUM specifies a parameter that should contain either numbers or letters only.
78  */
79 define('PARAM_ALPHANUM', 0x0400);
80
81 /**
82  * PARAM_BOOL specifies a parameter that should contain a 0 or 1 boolean value only. It will convert to value 1 or 0 using empty()
83  */
84 define('PARAM_BOOL',     0x0800);
85
86 /**
87  * PARAM_CLEANHTML specifies a parameter that should contain actual HTML code that you want cleaned and slashes removed
88  */
89 define('PARAM_CLEANHTML',0x1000);
90
91 /**
92  * PARAM_ALPHAEXT specifies a parameter that should contain the same contents as PARAM_ALPHA plus the chars in quotes: "/-_" allowed
93  */
94 define('PARAM_ALPHAEXT', 0x2000);
95
96 /**
97  * PARAM_SAFEDIR specifies a parameter that should contain a safe directory name, suitable for include() and require()
98  */
99 define('PARAM_SAFEDIR'0x4000);
100
101
102 /// Define text formatting types ... eventually we can add Wiki, BBcode etc
103
104 /**
105  * Does all sorts of transformations and filtering
106  */
107 define('FORMAT_MOODLE',   '0');   // Does all sorts of transformations and filtering
108
109 /**
110  * Plain HTML (with some tags stripped)
111  */
112 define('FORMAT_HTML',     '1');   // Plain HTML (with some tags stripped)
113
114 /**
115  * Plain text (even tags are printed in full)
116  */
117 define('FORMAT_PLAIN',    '2');   // Plain text (even tags are printed in full)
118
119 /**
120  * Wiki-formatted text
121  * Deprecated: left here just to note that '3' is not used (at the moment)
122  * and to catch any latent wiki-like text (which generates an error)
123  */
124 define('FORMAT_WIKI',     '3');   // Wiki-formatted text
125
126 /**
127  * Markdown-formatted text http://daringfireball.net/projects/markdown/
128  */
129 define('FORMAT_MARKDOWN', '4');   // Markdown-formatted text http://daringfireball.net/projects/markdown/
130
131
132 /**
133  * Allowed tags - string of html tags that can be tested against for safe html tags
134  * @global string $ALLOWED_TAGS
135  */
136 $ALLOWED_TAGS =
137 '<p><br><b><i><u><font><table><tbody><span><div><tr><td><th><ol><ul><dl><li><dt><dd><h1><h2><h3><h4><h5><h6><hr><img><a><strong><emphasis><em><sup><sub><address><cite><blockquote><pre><strike><param><acronym><nolink><lang><tex><algebra><math><mi><mn><mo><mtext><mspace><ms><mrow><mfrac><msqrt><mroot><mstyle><merror><mpadded><mphantom><mfenced><msub><msup><msubsup><munder><mover><munderover><mmultiscripts><mtable><mtr><mtd><maligngroup><malignmark><maction><cn><ci><apply><reln><fn><interval><inverse><sep><condition><declare><lambda><compose><ident><quotient><exp><factorial><divide><max><min><minus><plus><power><rem><times><root><gcd><and><or><xor><not><implies><forall><exists><abs><conjugate><eq><neq><gt><lt><geq><leq><ln><log><int><diff><partialdiff><lowlimit><uplimit><bvar><degree><set><list><union><intersect><in><notin><subset><prsubset><notsubset><notprsubset><setdiff><sum><product><limit><tendsto><mean><sdev><variance><median><mode><moment><vector><matrix><matrixrow><determinant><transpose><selector><annotation><semantics><annotation-xml><tt><code>';
138
139 /**
140  * Allowed protocols - array of protocols that are safe to use in links and so on
141  * @global string $ALLOWED_PROTOCOLS
142  */
143 $ALLOWED_PROTOCOLS = array('http', 'https', 'ftp', 'news', 'mailto', 'rtsp', 'teamspeak', 'gopher', 'mms',
144                            'color', 'callto', 'cursor', 'text-align', 'font-size', 'font-weight', 'font-style',
145                            'border', 'margin', 'padding');   // CSS as well to get through kses
146
147
148
149
150 ?>
Note: See TracBrowser for help on using the browser.