[development] node_get_types() question
drupal at f2s.com
Sat May 27 23:31:37 UTC 2006
I just got this issue on a module of mine:-
I have managed to reproduce the error and as far as I can
see the fix is trivial. However, it raises something I'm
not 100% sure on. The Drupal API docs state for hook_node_info():
"The 'name' value is a human-readable name for the node..."
Now, the error as reported to me is the name I use is "Jan's node"
which I believe to meet the criteria in the hook definition. The
problem comes in nmoderation.module due to this line:-
$types = implode("','", variable_get('nmoderation_node_types',
which feeds through to the SQL query thus
.. WHERE n.type IN ('$types') ..
I can fix my module and remove the quote in the name but as far as
I can tell nmoderation is not escaping before imploding. If the API
says "human-readable" then "Jan's node" complies. So, is the bug
my quote in the name or is the bug in nmoderation for not escaping
a "human-readable" string?
I'm normally careful about my quotes and do avoid them but in this
case when I wrote the module I interpreted the spec a little too
literally perhaps? Just looking for clarification.
More information about the development