aMule Forum

English => en_Bugs => Topic started by: visualage on January 03, 2008, 05:54:11 AM

Title: Regular expression in aMuleWeb-PHP/split function
Post by: visualage on January 03, 2008, 05:54:11 AM
It is better to comply the same mechanism as in standard PHP to use REG_EXTENDED in regcomp(). The following patch should be applied.

Code: [Select]
--- amule-cvs.orig/src/webserver/src/php_core_lib.cpp   2007-12-08 02:04:25.000000000 +0800
+++ amule-cvs/src/webserver/src/php_core_lib.cpp        2008-01-03 11:10:29.660948088 +0800
@@ -1475,7 +1475,7 @@
        }
        regex_t preg;
        char error_buff[256];
-       int reg_result = regcomp(&preg, pattern->str_val, 0);
+       int reg_result = regcomp(&preg, pattern->str_val, REG_EXTENDED);
        if ( reg_result ) {
                regerror(reg_result, &preg, error_buff, sizeof(error_buff));
                php_report_error(PHP_ERROR, "Failed in regcomp: %s", error_buff);
Title: Re: Regular expression in aMuleWeb-PHP/split function
Post by: lfroen on January 03, 2008, 10:13:47 AM
Thanks. I will apply it today.
Title: Re: Regular expression in aMuleWeb-PHP/split function
Post by: phoenix on January 04, 2008, 12:57:38 AM
Applied.

Thanks for your support.