summaryrefslogtreecommitdiff
path: root/ext/hyperwave/hg_comm.c
diff options
context:
space:
mode:
authorUwe Steinmann <steinm@php.net>2000-03-10 11:36:27 +0000
committerUwe Steinmann <steinm@php.net>2000-03-10 11:36:27 +0000
commitfc1bc7102f5ca562d510ca07cc119b7c9add587c (patch)
treefab8e0c46041c739014f4b97efee3b0274647a98 /ext/hyperwave/hg_comm.c
parent29ed30f77c43ecec00ee291b065dacbf6c4a0739 (diff)
downloadphp-git-fc1bc7102f5ca562d510ca07cc119b7c9add587c.tar.gz
- replaced some old code to access server variables
Diffstat (limited to 'ext/hyperwave/hg_comm.c')
-rw-r--r--ext/hyperwave/hg_comm.c23
1 files changed, 19 insertions, 4 deletions
diff --git a/ext/hyperwave/hg_comm.c b/ext/hyperwave/hg_comm.c
index a3fe28265d..aab3d3f7c9 100644
--- a/ext/hyperwave/hg_comm.c
+++ b/ext/hyperwave/hg_comm.c
@@ -590,13 +590,26 @@ char *fnInsAnchorsIntoText(char *text, DLIST *pAnchorList, char **bodytag, char
int laststart=0;
/* The following is very tricky and depends on how rewriting is setup on your webserver.
- If you skip the scriptname in the url you will have to map each hyperwave name to http://<hwname>.
- This may not always be a good idea. The best solution is probably to provide a prefix for such
- a case which is an optional parameter to hw_gettext hw_pipedocument.
+ If you skip the scriptname in the url you will have to map each hyperwave name
+ to http://<hwname>. This may not always be a good idea. The best solution is
+ probably to provide a prefix for such
+ a case which is an optional parameter to hw_gettext() or hw_pipedocument().
+ FIXME: Currently, the variable SCRIPT_NAME is empty thouht SCRIPT_URL is
+ not. In our case this is OK, since as mentioned above it is better to have no
+ SCRIPT_NAME than to have if rewriting is on.
*/
if(urlprefix) {
scriptname = urlprefix;
} else {
+ zval **script_name;
+ if (zend_hash_find(&EG(symbol_table), "SCRIPT_NAME", sizeof("SCRIPT_NAME"), (void **) &script_name)==FAILURE)
+ scriptname = NULL;
+ else {
+ convert_to_string_ex(script_name);
+ scriptname = (*script_name)->value.str.val;
+ }
+
+#if 0
#if APACHE
{
int j;
@@ -604,7 +617,8 @@ char *fnInsAnchorsIntoText(char *text, DLIST *pAnchorList, char **bodytag, char
table_entry *elts = (table_entry *)arr->elts;
for (j=0; j < arr->nelts; j++) {
- if(0 == strcmp(elts[j].key, "SCRIPT_NAME"))
+ if((0 == strcmp(elts[j].key, "SCRIPT_NAME")) ||
+ (0 == strcmp(elts[j].key, "SCRIPT_URL")))
break;
}
scriptname = elts[j].val;
@@ -612,6 +626,7 @@ char *fnInsAnchorsIntoText(char *text, DLIST *pAnchorList, char **bodytag, char
#else
scriptname = getenv("SCRIPT_FILENAME");
#endif
+#endif
}
newtext = text;