andrei          Mon Jan 22 14:05:05 2001 EDT

  Modified files:              
    /php4/ext/pcre      php_pcre.c 
  Log:
  If we can't call custom replacement function, don't change the subject
  string.
  
  
Index: php4/ext/pcre/php_pcre.c
diff -u php4/ext/pcre/php_pcre.c:1.80 php4/ext/pcre/php_pcre.c:1.81
--- php4/ext/pcre/php_pcre.c:1.80       Mon Jan 22 11:42:29 2001
+++ php4/ext/pcre/php_pcre.c    Mon Jan 22 14:05:04 2001
@@ -16,7 +16,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: php_pcre.c,v 1.80 2001/01/22 19:42:29 andrei Exp $ */
+/* $Id: php_pcre.c,v 1.81 2001/01/22 22:05:04 andrei Exp $ */
 
 /*
        TODO:
@@ -587,8 +587,8 @@
                zval_ptr_dtor(&retval_ptr);
        } else {
                php_error(E_WARNING, "Unable to call custom replacement function 
%s()", function_name);
-               *result = empty_string;
-               result_len = 0;
+               result_len = offsets[1] - offsets[0];
+               *result = estrndup(&subject[offsets[0]], result_len);
        }
        zval_dtor(subpats);
        FREE_ZVAL(subpats);



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to