xref: /PHP-8.2/ext/session/tests/021.phpt (revision b5a14e6c)
1--TEST--
2rewriter handles form and fieldset tags correctly
3--EXTENSIONS--
4session
5--SKIPIF--
6<?php include('skipif.inc'); ?>
7--INI--
8session.use_cookies=0
9session.use_only_cookies=0
10session.use_strict_mode=0
11session.cache_limiter=
12session.use_trans_sid=1
13url_rewriter.tags="a=href,area=href,frame=src,input=src,form=,fieldset="
14session.name=PHPSESSID
15session.serialize_handler=php
16session.save_handler=files
17--FILE--
18<?php
19
20error_reporting(E_ALL);
21ini_set('session.trans_sid_hosts', 'php.net');
22$_SERVER['HTTP_HOST'] = 'php.net';
23
24session_id("test021");
25session_start();
26?>
27<form action="//bad.net/do.php">
28<fieldset>
29<form action="//php.net/do.php">
30<fieldset>
31<?php
32
33ob_flush();
34
35ini_set("url_rewriter.tags", "a=href,area=href,frame=src,input=src,form=");
36
37?>
38<form action="../do.php">
39<fieldset>
40<?php
41
42ob_flush();
43
44ini_set("url_rewriter.tags", "a=href,area=href,frame=src,input=src,form=fakeentry");
45
46?>
47<form action="/do.php">
48<fieldset>
49<?php
50
51ob_flush();
52
53ini_set("url_rewriter.tags", "a=href,fieldset=,area=href,frame=src,input=src");
54
55?>
56<form action="/foo/do.php">
57<fieldset>
58<?php
59
60session_destroy();
61?>
62--EXPECT--
63<form action="//bad.net/do.php">
64<fieldset>
65<form action="//php.net/do.php"><input type="hidden" name="PHPSESSID" value="test021" />
66<fieldset>
67<form action="../do.php"><input type="hidden" name="PHPSESSID" value="test021" />
68<fieldset>
69<form action="/do.php"><input type="hidden" name="PHPSESSID" value="test021" />
70<fieldset>
71<form action="/foo/do.php"><input type="hidden" name="PHPSESSID" value="test021" />
72<fieldset>
73