|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2010-04-14 10:33 UTC] RQuadling at GMail dot com
Description: ------------ Setting wincache.namesalt to a string greater than 9 characters, will be reported as a string with a null at offset 8. e.g. wincache.namesalt=PHP_WINCACHE will be reported as ... wincache.namesalt=PHP_WINC\000CHE At the command prompt, php --ri wincache shows a space. phpinfo() shows nothing - PHP_WINCCHE. Reproduce code: --------------- php.exe -d wincache.namesalt=PHP_WINCACHE --ri wincache Expected result: ---------------- wincache Opcode cache => enabled File cache => enabled Version => 1.1.0412.0 Owner => iisphp@microsoft.com Build Date => Apr 13 2010 17:38:02 Directive => Local Value => Master Value wincache.fcenabled => On => On wincache.ocenabled => On => On wincache.enablecli => On => On wincache.fcachesize => 128 => 128 wincache.ocachesize => 128 => 128 wincache.maxfilesize => 256 => 256 wincache.filecount => 4096 => 4096 wincache.chkinterval => 0 => 0 wincache.ttlmax => 1200 => 1200 wincache.debuglevel => 101 => 101 wincache.ignorelist => no value => no value wincache.ocenabledfilter => no value => no value wincache.fcenabledfilter => no value => no value wincache.namesalt => PHP_WINCACHE => PHP_WINCACHE wincache.localheap => 0 => 0 wincache.ucenabled => On => On wincache.ucachesize => 8 => 8 wincache.scachesize => 8 => 8 wincache.rerouteini => no value => no value wincache.fcndetect => On => On Actual result: -------------- wincache Opcode cache => enabled File cache => enabled Version => 1.1.0412.0 Owner => iisphp@microsoft.com Build Date => Apr 13 2010 17:38:02 Directive => Local Value => Master Value wincache.fcenabled => On => On wincache.ocenabled => On => On wincache.enablecli => On => On wincache.fcachesize => 128 => 128 wincache.ocachesize => 128 => 128 wincache.maxfilesize => 256 => 256 wincache.filecount => 4096 => 4096 wincache.chkinterval => 0 => 0 wincache.ttlmax => 1200 => 1200 wincache.debuglevel => 101 => 101 wincache.ignorelist => no value => no value wincache.ocenabledfilter => no value => no value wincache.fcenabledfilter => no value => no value wincache.namesalt => PHP_WINC CHE => PHP_WINC CHE wincache.localheap => 0 => 0 wincache.ucenabled => On => On wincache.ucachesize => 8 => 8 wincache.scachesize => 8 => 8 wincache.rerouteini => no value => no value wincache.fcndetect => On => On PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 29 20:00:01 2025 UTC |
The issue isn't that the namesalt is not documented to only allow 8 characters, the issue is the odd display when more than 9 characters are used. PHP_WINCACHE becomes PHP_WINCCHE or PHP_WINC CHE depending upon what ui you are using (web or CLI). Mmaybe, in php_wincache.c, the code ... /* Truncate namesalt to 8 characters */ if(WCG(namesalt) != NULL && strlen(WCG(namesalt)) > NAMESALT_LENGTH_MAXIMUM) { *(WCG(namesalt) + NAMESALT_LENGTH_MAXIMUM) = 0; } should also fill in the rest of the string. /* Truncate namesalt to 8 characters */ if(WCG(namesalt) != NULL && strlen(WCG(namesalt)) > NAMESALT_LENGTH_MAXIMUM) { int saltLength = strlen(WCG(namesalt); while(saltLength > NAMESALT_LENGTH_MAXIMUM) { *(WCG(namesalt) + --saltLength) = 0; } } That should stop the error I'm currently seeing. Essentially, just documenting the limitation and having nothing to enforce it seems wrong. If phpinfo is able to report the corrupted value, what else can use it incorrectly. NOTE: wincache.php will also see PHP_WINCCHE, more than 8 characters.