Whenever I try to use the "Enter PHP Code if true" extra '' are added to my code. For example a simple snippet like:

<?php
global $user;
if (in_array('Approved Role',$user->roles)) {
return TRUE;
} else {
return FALSE;
}
?>

is changed to:

<?php
global $user;
if (in_array(''''Approved Role'''',$user->roles)) {
return TRUE;
} else {
return FALSE;
}
?>

This happens whenever I try to use any PHP snippets - not just with the block visibility settings. I am using a plain text editor.

I've searched the Drupal issues, but didn't find any issues for this or any patch. Help please!

Comments

MsDetta’s picture

Title: Can't Use PHP Code » Add'l Info

Thought it might help if you have some additional information:

Drupal version 4.7.4
Server: Linux running Apache 1.3.37 (Unix)
PHP version 5.1.6
mySQL version 4.1.21-standard

I'm also getting array and array merge errors whenever I use an apostrophe (') in the help text area.

chx’s picture

Title: Add'l Info » Extra apostrophes when entering PHP code in a textarea
mot’s picture

Status: Active » Closed (fixed)

No activity since a long, long time. Closed.