[kwlug-disc] PHP code question

Bill Traynor btraynor at gmail.com
Wed Sep 7 10:39:56 EDT 2011


I'm trying to debug a PHP error caused by a typo in a module somewhere.  The
exact errors are:

Unexpected character in input:  ''' (ASCII=39) state=1 in /var/www/
dev.meld.org/drupal-6.x/sites/all/modules/ctools/plugins/access/php.inc(55)<http://dev.meld.org/drupal-6.x/sites/all/modules/ctools/plugins/access/php.inc%2855%29>:
eval()'d code on line 1, referer:
http://dev.meld.org/admin/build/modules/list
Unexpected character in input:  ''' (ASCII=39) state=1 in /var/www/
dev.meld.org/drupal-6.x/sites/all/modules/ctools/plugins/access/php.inc(55)<http://dev.meld.org/drupal-6.x/sites/all/modules/ctools/plugins/access/php.inc%2855%29>:
eval()'d code on line 1, referer:
http://dev.meld.org/
Unexpected character in input:  ''' (ASCII=39) state=1 in /var/www/
dev.meld.org/drupal-6.x/sites/all/modules/ctools/plugins/access/php.inc(55)<http://dev.meld.org/drupal-6.x/sites/all/modules/ctools/plugins/access/php.inc%2855%29>:
eval()'d code on line 1, referer:
http://dev.meld.org/member/register
Unexpected character in input:  ''' (ASCII=39) state=1 in /var/www/
dev.meld.org/drupal-6.x/sites/all/modules/ctools/plugins/access/php.inc(55)<http://dev.meld.org/drupal-6.x/sites/all/modules/ctools/plugins/access/php.inc%2855%29>:
eval()'d code on line 1, referer:
http://dev.meld.org/member/register

To debug this, it's been suggested to me to go to line 55 in
sites/all/modules/ctools/plugins/access/php.inc and add throw new Exception
to find the offending module.  You'll want to condition the throw new
Exception to only when arg(0) == 'member' && arg(1) == 'register'.

Line 55 is this function:

function ctools_php_ctools_access_check($__conf, $contexts) {
  $access = eval($__conf['php']);
  return $access;
}

As an admitted PHP neophyte, I have no idea how to add the Exception.  As
fixing this bug as fast as possible is my priority right now, can anyone
tell me how to add the Exception to that function?

Thanks
Bill
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://kwlug.org/pipermail/kwlug-disc_kwlug.org/attachments/20110907/0588d27c/attachment.html>


More information about the kwlug-disc mailing list