Lines Matching refs:filename
416 char *filename = NULL; local
454 …spprintf(&filename, 0, "%s%c%s%c%s", pw->pw_dir, PHP_DIR_SEPARATOR, PG(user_dir), PHP_DIR_SEPARATO…
456 filename = SG(request_info).path_translated;
467 filename = emalloc(length + path_len + 2);
468 if (filename) {
469 memcpy(filename, PG(doc_root), length);
470 if (!IS_SLASH(filename[length - 1])) { /* length is never 0 */
471 filename[length++] = PHP_DIR_SEPARATOR;
476 strncpy(filename + length, path_info, path_len + 1);
479 filename = SG(request_info).path_translated;
483 if (filename) {
484 resolved_path = zend_resolve_path(filename, strlen(filename) TSRMLS_CC);
488 if (SG(request_info).path_translated != filename) {
489 STR_FREE(filename);
510 if (SG(request_info).path_translated != filename) {
511 STR_FREE(filename);
520 if (SG(request_info).path_translated != filename) {
522 SG(request_info).path_translated = filename;
525 file_handle->filename = SG(request_info).path_translated;
537 PHPAPI char *php_resolve_path(const char *filename, int filename_length, const char *path TSRMLS_DC) argument
545 if (!filename) {
549 if (strlen(filename) != filename_length) {
554 for (p = filename; isalnum((int)*p) || *p == '+' || *p == '-' || *p == '.'; p++);
555 if ((*p == ':') && (p - filename > 1) && (p[1] == '/') && (p[2] == '/')) {
556 …wrapper = php_stream_locate_url_wrapper(filename, &actual_path, STREAM_OPEN_FOR_INCLUDE TSRMLS_CC);
565 if ((*filename == '.' &&
566 (IS_SLASH(filename[1]) ||
567 ((filename[1] == '.') && IS_SLASH(filename[2])))) ||
568 IS_ABSOLUTE_PATH(filename, filename_length) ||
571 if (tsrm_realpath(filename, resolved_path TSRMLS_CC)) {
599 memcpy(trypath+(end-ptr)+1, filename, filename_length+1);
609 memcpy(trypath+len+1, filename, filename_length+1);
644 memcpy(trypath+exec_fname_length + 1, filename, filename_length+1);
679 PHPAPI FILE *php_fopen_with_path(const char *filename, const char *mode, const char *path, char **o… argument
694 if (!filename) {
698 filename_length = strlen(filename);
701 if (*filename == '.') {
702 if (PG(safe_mode) && (!php_checkuid(filename, mode, CHECKUID_CHECK_MODE_PARAM))) {
705 return php_fopen_and_set_opened_path(filename, mode, opened_path TSRMLS_CC);
714 if (IS_ABSOLUTE_PATH(filename, filename_length)) {
715 if (php_check_safe_mode_include_dir(filename TSRMLS_CC) == 0) {
717 return php_fopen_and_set_opened_path(filename, mode, opened_path TSRMLS_CC);
719 if (PG(safe_mode) && (!php_checkuid(filename, mode, CHECKUID_CHECK_MODE_PARAM))) {
722 return php_fopen_and_set_opened_path(filename, mode, opened_path TSRMLS_CC);
726 if (PG(safe_mode) && (!php_checkuid(filename, mode, CHECKUID_CHECK_MODE_PARAM))) {
729 return php_fopen_and_set_opened_path(filename, mode, opened_path TSRMLS_CC);
764 if (snprintf(trypath, MAXPATHLEN, "%s/%s", ptr, filename) >= MAXPATHLEN) {
765 …php_error_docref(NULL TSRMLS_CC, E_NOTICE, "%s/%s path was truncated to %d", ptr, filename, MAXPAT…