File: get_magic_quotes_gpc.phpt

package info (click to toggle)
php5 5.3.3.1-7%2Bsqueeze29
  • links: PTS, VCS
  • area: main
  • in suites: squeeze-lts
  • size: 123,520 kB
  • ctags: 55,742
  • sloc: ansic: 633,963; php: 19,620; sh: 11,344; xml: 5,816; cpp: 2,400; yacc: 1,745; exp: 1,514; makefile: 1,019; pascal: 623; awk: 537; sql: 22
file content (49 lines) | stat: -rw-r--r-- 1,207 bytes parent folder | download | duplicates (3)
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
49
--TEST--
Test get_magic_quotes_gpc() function
--INI--
magic_quotes_gpc = 0
--FILE--
<?php
/* Prototype: int get_magic_quotes_gpc  ( void  )
 * Description: Gets the current configuration setting of magic quotes gpc
*/

echo "Simple testcase for get_magic_quotes_gpc() function\n";

$g = get_magic_quotes_gpc();
echo "\n-- magic quotes gpc set in INI file: " . $g . " --\n";

echo "\n-- Set magic quotes gpc to 1 - not allowed so should fail! --\n";
var_dump(ini_set("magic_quotes_gpc", 1));
$g = get_magic_quotes_gpc();
echo "\n-- magic quotes gpc after set: " . $g . " --\n";

echo "\n-- Set magic quotes gpc to 0:  --\n";
var_dump(ini_set("magic_quotes_gpc", 0));
$g = get_magic_quotes_gpc();
echo "\n-- magic quotes gpc after set: " . $g . " --\n";

echo "\n-- Error cases --\n"; 
// no checks on number of args
var_dump(get_magic_quotes_gpc(true)); 

?>
===DONE===
--EXPECT--
Simple testcase for get_magic_quotes_gpc() function

-- magic quotes gpc set in INI file: 0 --

-- Set magic quotes gpc to 1 - not allowed so should fail! --
bool(false)

-- magic quotes gpc after set: 0 --

-- Set magic quotes gpc to 0:  --
bool(false)

-- magic quotes gpc after set: 0 --

-- Error cases --
int(0)
===DONE===