#21626 [NEW]: ucwords() fails to capitalize words in parenthesis
| From: | ieure at debian dot org | Date: | Tue, 14 Jan 2003 01:06:35 +0000 |
| Subject: | #21626 [NEW]: ucwords() fails to capitalize words in parenthesis | ||
| Groups: | php.bugs php.bugs | ||
| Request: | Send a blank email to php-bugs+get-29957@lists.php.net to get a copy of this message | ||
From: ieure@debian.org
Operating system: Debian GNU/Linux 3.0 (Woody)
PHP version: 4.2.1
PHP Bug Type: Strings related
Bug description: ucwords() fails to capitalize words in parenthesis
When using ucwords() on a string which contains words in
parenthesis, the first word in the parenthesis is not
capitalized.
Here's a quick example, pasted from an xterm.
-- snip --
ieure!Phaktory:~$ cat ucwords.php
#!/usr/bin/php4 -q
<?php
echo ucwords($_SERVER['argv'][1])."\n";
?>
ieure!Phaktory:~$ ./ucwords.php 'test'
Test
ieure!Phaktory:~$ ./ucwords.php 'test test'
Test Test
ieure!Phaktory:~$ ./ucwords.php 'test test (test)'
Test Test (test)
ieure!Phaktory:~$ ./ucwords.php 'test test (test test)'
Test Test (test Test)
ieure!Phaktory:~$ ./ucwords.php 'test test ( test test)'
Test Test ( Test Test)
ieure!Phaktory:~$
-- snip --
As you can see, ucwords() won't capitalize the first 'test'
when there is no whitespace between the open-parenthesis
and the first letter.
Affects both CGI and Apache module versions. Here's the
script I used to test the apache module:
<?php
echo ucwords($_GET['string']);
?>
--
Edit bug report at http://bugs.php.net/?id=21626&edit=1
--
Try a CVS snapshot: http://bugs.php.net/fix.php?id=21626&r=trysnapshot
Fixed in CVS: http://bugs.php.net/fix.php?id=21626&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=21626&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=21626&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=21626&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=21626&r=support
Expected behavior: http://bugs.php.net/fix.php?id=21626&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=21626&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=21626&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=21626&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=21626&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=21626&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=21626&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=21626&r=gnused