PHP userland backwards compatibility layer that emulates PHP 5.5+ core functions.

⌈⌋ ⎇ branch:  upgrade.php


Check-in [1425670b2d]

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:(no comment)
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 1425670b2dc8f8f906adc4edb48ab4165b926c9e
User & Date: mario 2013-12-17 04:25:48
Context
2013-12-17
04:28
remove input.README.pdf pertaining to original access syntax check-in: 50af5cd55a user: mario tags: trunk
04:25
(no comment) check-in: 1425670b2d user: mario tags: trunk
04:24
Add input.php superglobals wrapper 2.5 check-in: 15c58ac072 user: mario tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Added ext/contrib/setcookie2.php.















































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
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
<?php

 
/**
 * Set-Cookie2 support, with a workaround for headers_sent.
 * Originally a rejected patch http://marc.info/?l=php-internals&m=118802375714734
 * Kind of redundant, since none of the current browsers seems to support it.
 *
 */
if (!function_exists("setcookie2")) {
   function setcookie2($name, $value="", $maxage=NULL, $comment=NULL, $commenturl=NULL, $path=NULL, $domain=NULL, $portlist=NULL, $secure=NULL, $httponly=NULL, $version=1) {

       if (strpbrk($name.$value, "\r\n\000\013\014")) {
           trigger_error("Invalid control characters in cookie name or value", E_USER_WARNING);
       }
       else {
           extract(array_map("urlencode", get_defined_vars()));
           $cookie = "$name=$value"
                   . ($maxage	? "; maxage=".intval($maxage)		: "")
                   . ($comment	? "; comment=\"$comment\""		: "")
                   .($commenturl? "; commenturl=\"$commenturl\""	: "")
                   . ($path	? "; path=\"$path\""			: "")
                   . ($domain	? "; domain=$domain"			: "")
                   . ($portlist	? "; portlist=\"$portlist\""		: "")
                   . ($secure	? "; secure"				: "")
                   . ($httponly	? "; httponly"				: "")
                   . ($version	? "; version=".intval($version)		: "");
           if (!headers_sent() || strstr(ini_get("defalt_mimetype"), "+xml")) {
               header("Set-Cookie2: $cookie");
           }
           else {
               trigger_error("Headers already sent. Using a meta http-equiv workaround", E_USER_NOTICE);
               print "<meta http-equiv=\"Set-Cookie2\" content=\"" . htmlspecialchars($cookie, ENT_QUOTES, "UTF-8") . "\">";
           }
       }
   }
}