zenovich / runkit

Runkit (official PECL PHP Runkit extension)
http://pecl.php.net/runkit
Other
611 stars 136 forks source link

Fix runkit function manipulation for namespaced functions with a leading "\" (Issue #90) #91

Closed TysonAndre closed 9 years ago

TysonAndre commented 9 years ago

And add a test of runkit function manipulation for namespaced functions (Based off of namespaces.phpt)

Runkit will allow both "\NamespaceName\ClassName" and "NamespaceName\ClassName" for runkit method manipulation functions. It should also allow both "\NamespaceName\function_name" and "NamespaceName\function_name"

It was previously only working properly for function names of the form "NamespaceName\function_name".

I verified that all tests passed after this change, including the test that I added.

zenovich commented 9 years ago

Good catch! The patch looks good too. Why not use the same macro for class names in runkit_method.c? We need also to add new test into package.xml and describe the correction there. Thanks!

TysonAndre commented 9 years ago

I already used that macro in the class fetcher of runkit_methods.c

I didn't notice package.xml, I'll update that when I get home. I assume all I need to add is a similar element?

zenovich commented 9 years ago

Sorry I haven't caught sight your patch for runkit_methods.c, now I see it. Yes, the similar element and the description of correction.

TysonAndre commented 9 years ago

Added the file, and added a note under "Fixes" to the <notes>...</notes> section for 1.0.5-dev.

I also changed this PR to reuse the same macro for constant names in runkit_constants.c, and check if the string's length is positive first