diff options
| author | Stanislav Malyshev <stas@php.net> | 2012-08-05 21:13:39 -0700 |
|---|---|---|
| committer | Stanislav Malyshev <stas@php.net> | 2012-08-05 21:15:53 -0700 |
| commit | c9eb64127e2d25c09672beacffdd34c8e7e3ddd2 (patch) | |
| tree | 46bd068f2cf0cd9c6ab8774fe3ae0f17d970b449 /sapi | |
| parent | 1a41607d462ec2bfe9725821c541bae78282d8a5 (diff) | |
| parent | b1a997e2a25d1f1422a237e12cff19a70a8eb317 (diff) | |
| download | php-git-c9eb64127e2d25c09672beacffdd34c8e7e3ddd2.tar.gz | |
Merge branch 'pull-request/132'
* pull-request/132:
OK, bye bye JavaScript, let's just include credits before license
Nicer (JSLint-compliant!) credits reveal JavaScript
Removed now-unnecessary expose_php checks for logo
Fixed small misalignment in prev commit
Removed Logo GUIDs and replaced with Data URIs and div hidden with JS
Diffstat (limited to 'sapi')
| -rw-r--r-- | sapi/cli/php_cli_server.c | 56 | ||||
| -rw-r--r-- | sapi/cli/tests/php_cli_server_011.phpt | 41 |
2 files changed, 27 insertions, 70 deletions
diff --git a/sapi/cli/php_cli_server.c b/sapi/cli/php_cli_server.c index e80ab68f80..89262e863d 100644 --- a/sapi/cli/php_cli_server.c +++ b/sapi/cli/php_cli_server.c @@ -1948,40 +1948,38 @@ static int php_cli_server_request_shutdown(php_cli_server *server, php_cli_serve static int php_cli_server_dispatch_router(php_cli_server *server, php_cli_server_client *client TSRMLS_DC) /* {{{ */ { int decline = 0; - if (!php_handle_special_queries(TSRMLS_C)) { - zend_file_handle zfd; - char *old_cwd; - - ALLOCA_FLAG(use_heap) - old_cwd = do_alloca(MAXPATHLEN, use_heap); - old_cwd[0] = '\0'; - php_ignore_value(VCWD_GETCWD(old_cwd, MAXPATHLEN - 1)); - - zfd.type = ZEND_HANDLE_FILENAME; - zfd.filename = server->router; - zfd.handle.fp = NULL; - zfd.free_filename = 0; - zfd.opened_path = NULL; - - zend_try { - zval *retval = NULL; - if (SUCCESS == zend_execute_scripts(ZEND_REQUIRE TSRMLS_CC, &retval, 1, &zfd)) { - if (retval) { - decline = Z_TYPE_P(retval) == IS_BOOL && !Z_LVAL_P(retval); - zval_ptr_dtor(&retval); - } - } else { - decline = 1; + zend_file_handle zfd; + char *old_cwd; + + ALLOCA_FLAG(use_heap) + old_cwd = do_alloca(MAXPATHLEN, use_heap); + old_cwd[0] = '\0'; + php_ignore_value(VCWD_GETCWD(old_cwd, MAXPATHLEN - 1)); + + zfd.type = ZEND_HANDLE_FILENAME; + zfd.filename = server->router; + zfd.handle.fp = NULL; + zfd.free_filename = 0; + zfd.opened_path = NULL; + + zend_try { + zval *retval = NULL; + if (SUCCESS == zend_execute_scripts(ZEND_REQUIRE TSRMLS_CC, &retval, 1, &zfd)) { + if (retval) { + decline = Z_TYPE_P(retval) == IS_BOOL && !Z_LVAL_P(retval); + zval_ptr_dtor(&retval); } - } zend_end_try(); - - if (old_cwd[0] != '\0') { - php_ignore_value(VCWD_CHDIR(old_cwd)); + } else { + decline = 1; } + } zend_end_try(); - free_alloca(old_cwd, use_heap); + if (old_cwd[0] != '\0') { + php_ignore_value(VCWD_CHDIR(old_cwd)); } + free_alloca(old_cwd, use_heap); + return decline; } /* }}} */ diff --git a/sapi/cli/tests/php_cli_server_011.phpt b/sapi/cli/tests/php_cli_server_011.phpt deleted file mode 100644 index a957a8ed4c..0000000000 --- a/sapi/cli/tests/php_cli_server_011.phpt +++ /dev/null @@ -1,41 +0,0 @@ ---TEST-- -Bug #60180 ($_SERVER["PHP_SELF"] incorrect) ---SKIPIF-- -<?php -include "skipif.inc"; -?> ---FILE-- -<?php -include "php_cli_server.inc"; -php_cli_server_start('sytanx error;', TRUE); - -list($host, $port) = explode(':', PHP_CLI_SERVER_ADDRESS); -$port = intval($port)?:80; - -$fp = fsockopen($host, $port, $errno, $errstr, 0.5); -if (!$fp) { - die("connect failed"); -} - -$logo_id = php_logo_guid(); - -if(fwrite($fp, <<<HEADER -GET /?={$logo_id} HTTP/1.1 -Host: {$host} - - -HEADER -)) { - while (!feof($fp)) { - if (("Content-Type: image/gif") == trim(fgets($fp))) { - echo "okey"; - break; - } - } -} - -fclose($fp); - -?> ---EXPECTF-- -okey |
