Index: apc_compile.c =================================================================== RCS file: /repository/pecl/apc/apc_compile.c,v retrieving revision 3.82 diff -u -r3.82 apc_compile.c --- apc_compile.c 17 Mar 2007 14:07:14 -0000 3.82 +++ apc_compile.c 22 Mar 2007 23:39:20 -0000 @@ -1094,6 +1094,8 @@ int local_dst_alloc = 0; #ifdef APC_EXPERIMENTAL_OPTIMISATIONS apc_fileinfo_t fileinfo; + char canon_path[MAXPATHLEN]; + char *fullpath = NULL; #endif #ifdef ZEND_ENGINE_2 apc_opflags_t * flags = NULL; @@ -1269,11 +1271,14 @@ /* constant includes */ if(!IS_ABSOLUTE_PATH(Z_STRVAL_P(&zo->op1.u.constant),len)) { if (apc_search_paths(Z_STRVAL_P(&zo->op1.u.constant), PG(include_path), &fileinfo) == 0) { - zend_op *dzo = &(dst->opcodes[i]); - deallocate(dzo->op1.u.constant.value.str.val); - dzo->op1.u.constant.value.str.len = strlen(fileinfo.fullpath); - dzo->op1.u.constant.value.str.val = apc_xstrdup(fileinfo.fullpath, - allocate); + if((IS_ABSOLUTE_PATH(fileinfo.fullpath, strlen(fileinfo.fullpath)) && (fullpath = fileinfo.fullpath)) + || (fullpath = realpath(fileinfo.fullpath, canon_path))) { + /* is either an absolute path or it goes through a realpath() */ + zend_op *dzo = &(dst->opcodes[i]); + deallocate(dzo->op1.u.constant.value.str.val); + dzo->op1.u.constant.value.str.len = strlen(fullpath); + dzo->op1.u.constant.value.str.val = apc_xstrdup(fullpath, allocate); + } } } }