cvs: /php4/ext/hyperwave hg_comm.c /php4/tests testhyperwave
| From: | Uwe Steinmann | Date: | Thu, 09 Mar 2000 12:46:24 +0000 |
| Subject: | cvs: /php4/ext/hyperwave hg_comm.c /php4/tests testhyperwave | ||
| Groups: | php.version4 | ||
| Request: | Send a blank email to php-version4+get-11798@lists.php.net to get a copy of this message | ||
steinm Thu Mar 9 04:46:24 2000 EDT
Modified files:
/php4/ext/hyperwave hg_comm.c
/php4/tests testhyperwave
Log:
- bug fix, insertion of links back into HTML document
- smarter test script
Index: php4/ext/hyperwave/hg_comm.c
diff -u php4/ext/hyperwave/hg_comm.c:1.25 php4/ext/hyperwave/hg_comm.c:1.26
--- php4/ext/hyperwave/hg_comm.c:1.25 Wed Mar 8 09:51:57 2000
+++ php4/ext/hyperwave/hg_comm.c Thu Mar 9 04:45:54 2000
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: hg_comm.c,v 1.25 2000/03/08 17:51:57 steinm Exp $ */
+/* $Id: hg_comm.c,v 1.26 2000/03/09 12:45:54 steinm Exp $ */
/* #define HW_DEBUG */
@@ -461,7 +461,7 @@
char *htmlattr, *str2;
int offset;
str1 = object;
- htmlattr = emalloc(strlen(object));
+ htmlattr = emalloc(strlen(object)); /* alloc mem big enough for htmlattr */
htmlattr[0] = '\0';
offset = 0;
while(NULL != (str = strstr(str1, "HtmlAttr="))) {
@@ -469,7 +469,9 @@
str1 = str;
while((*str1 != '\n') && (*str1 != '\0'))
str1++;
- if(NULL != (str2 = strchr(str, '='))) {
+ /* Find the '=' in the HTML attr and make sure it is part of the
+ attr and not somewhere in the objrec. */
+ if((NULL != (str2 = strchr(str, '='))) && (str2 < str1)) {
str2++;
strncpy(&htmlattr[offset], str, str2 - str);
offset = offset + (str2 - str);
Index: php4/tests/testhyperwave
diff -u php4/tests/testhyperwave:1.3 php4/tests/testhyperwave:1.4
--- php4/tests/testhyperwave:1.3 Wed Mar 8 09:51:57 2000
+++ php4/tests/testhyperwave Thu Mar 9 04:45:54 2000
@@ -27,8 +27,8 @@
/* Lists an object array
*/
function list_attr($attributes) {
- var_dump($attributes);
- return;
+// var_dump($attributes);
+// return;
for($i=0; $i<count($attributes); $i++) {
$key = key($attributes);
switch($key) {
@@ -59,7 +59,17 @@
printf("\n");
break;
default:
- printf("%s = %s\n", $key, $attributes[$key]);
+ if(is_array($attributes[$key])) {
+ $group_arr = $attributes[$key];
+ $cj = count($group_arr);
+ for($j=0; $j<$cj; $j++) {
+ printf("%s = %s\n", $key, $group_arr[$j]);
+ next($group_arr);
+ }
+ } else {
+ printf("%s = %s\n", $key, $attributes[$key]);
+ }
+
}
next($attributes);
}