aMule Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

We're back! (IN POG FORM)

Author Topic: Regular expression in aMuleWeb-PHP/split function  (Read 2334 times)

visualage

  • Approved Newbie
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 12
Regular expression in aMuleWeb-PHP/split function
« 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);
Logged

lfroen

  • Guest
Re: Regular expression in aMuleWeb-PHP/split function
« Reply #1 on: January 03, 2008, 10:13:47 AM »

Thanks. I will apply it today.
Logged

phoenix

  • Evil respawning bird from aMule Dev Team
  • Developer
  • Hero Member
  • *****
  • Karma: 44
  • Offline Offline
  • Posts: 2503
  • The last shadow you'll ever see
Re: Regular expression in aMuleWeb-PHP/split function
« Reply #2 on: January 04, 2008, 12:57:38 AM »

Applied.

Thanks for your support.
Logged