Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:16349 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 95960 invoked by uid 1010); 31 May 2005 17:57:20 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 79279 invoked from network); 31 May 2005 17:48:57 -0000 Received: from unknown (HELO php.net) (127.0.0.1) by localhost with SMTP; 31 May 2005 17:48:57 -0000 X-Host-Fingerprint: 169.229.139.92 dhcp-139-92.OHR.Berkeley.EDU Received: from ([169.229.139.92:29286] helo=localhost.localdomain) by pb1.pair.com (ecelerity 1.2 r(5656M)) with SMTP id 36/7D-53744-783AC924 for ; Tue, 31 May 2005 13:48:55 -0400 Message-ID: <36.7D.53744.783AC924@pb1.pair.com> To: internals@lists.php.net References: <5.1.0.14.2.20050531072657.035ad6b0@localhost> Date: Tue, 31 May 2005 10:48:51 -0700 Lines: 42 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1478 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1478 X-Posted-By: 169.229.139.92 Subject: Re: SID was accidently changed to CONST_CS? From: pollita@php.net ("Sara Golemon") > >- REGISTER_STRINGL_CONSTANT("SID", empty_string, 0, 0); > >+ REGISTER_STRINGL_CONSTANT("SID", "", 0, 1); > > > > Where flags changed from 0 to 1.. > > Intentional or not? > > > Yes, the flag change was intentional in order to create an allocated empty > string. > The fourth parameter to REGISTER_STRINGL_CONSTANT is supposed to be flags (e.g. CONST_CS, CONST_PERSIST) not a copy indicator. The underlying implementation of zend_register_stringl_constant() never copies value: #define REGISTER_STRINGL_CONSTANT(name, str, len, flags) zend_register_stringl_constant((name), sizeof(name), (str), (len), (flags), module_number TSRMLS_CC) ZEND_API void zend_register_stringl_constant(char *name, uint name_len, char *strval, uint strlen, int flags, int module_number TSRMLS_DC) { zend_constant c; c.value.type = IS_STRING; c.value.value.str.val = strval; c.value.value.str.len = strlen; c.flags = flags; c.name = zend_strndup(name, name_len-1); c.name_len = name_len; c.module_number = module_number; zend_register_constant(&c TSRMLS_CC); } By setting flags to 1 (the value of CONST_CS), the zend_register_constant() function uses the unmodified "SID" as the constant name, rather than the strtolower()'d "sid" which is what session_regenerate_id() attempts to destroy. -Sara