dmitry Thu Mar 23 10:20:14 2006 UTC Modified files: /php-src/sapi/cgi cgi_main.c Log: MTH: Allowed '-b' with UNIX sockets http://cvs.php.net/viewcvs.cgi/php-src/sapi/cgi/cgi_main.c?r1=1.281&r2=1.282&diff_format=u Index: php-src/sapi/cgi/cgi_main.c diff -u php-src/sapi/cgi/cgi_main.c:1.281 php-src/sapi/cgi/cgi_main.c:1.282 --- php-src/sapi/cgi/cgi_main.c:1.281 Fri Mar 17 13:45:43 2006 +++ php-src/sapi/cgi/cgi_main.c Thu Mar 23 10:20:14 2006 @@ -20,7 +20,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: cgi_main.c,v 1.281 2006/03/17 13:45:43 dmitry Exp $ */ +/* $Id: cgi_main.c,v 1.282 2006/03/23 10:20:14 dmitry Exp $ */ #include "php.h" #include "php_globals.h" @@ -869,6 +869,19 @@ exit(0); } +#ifndef PHP_WIN32 +static int is_port_number(const char *bindpath) +{ + while (*bindpath) { + if (*bindpath < '0' || *bindpath > '9') { + return 0; + } + bindpath++; + } + return 1; +} +#endif + /* {{{ main */ int main(int argc, char *argv[]) @@ -1104,7 +1117,7 @@ * path (it's what the fastcgi library expects) */ - if (strchr(bindpath, ':') == NULL) { + if (strchr(bindpath, ':') == NULL && is_port_number(bindpath)) { char *tmp; tmp = malloc(strlen(bindpath) + 2);
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php