summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmiel Bruijntjes <emiel.bruijntjes@copernica.com>2015-04-11 21:12:49 +0200
committerEmiel Bruijntjes <emiel.bruijntjes@copernica.com>2015-04-11 21:12:49 +0200
commita860f85e80c48b821c8cb53fc1d98d5ac2f6f07a (patch)
tree9fad772a13904d543d0ed5a7875d6c7366082b89
parentd24dcfa4dba490512e3d417c71c0bb2c02e2881d (diff)
function names are now turned into lowercase name when registering them with zend, this is necessary because all functions are lowercase, and function-table lookups were failing, and more importantly: the removal of functions was failing when a module was unloaded
-rw-r--r--zend/hiddenpointer.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/zend/hiddenpointer.h b/zend/hiddenpointer.h
index d2636e3..147886e 100644
--- a/zend/hiddenpointer.h
+++ b/zend/hiddenpointer.h
@@ -38,8 +38,14 @@ public:
// copy pointer into the buffer
memcpy(buffer, &pointer, sizeof(Type *));
- // copy the name into the buffer
- memcpy(buffer + sizeof(Type *), text, size + 1);
+ // copy the name into the buffer, making it lower case at the same time
+ // (php function names are case insensitive, and must even be lowercase
+ // because all the lookups are done in lowercase)
+ for (int i = 0; i < size + 1; i++)
+ {
+ // convert char the lower case
+ buffer[sizeof(Type *) + i] = tolower(text[i]);
+ }
// store in member
_buffer = buffer;