Error: Cannot redeclare filter_xss_bad_protocol()

marcvangend - October 4, 2009 - 09:13
Project:High-performance JavaScript callback handler
Version:6.x-2.x-dev
Component:Code
Category:support request
Priority:normal
Assigned:Unassigned
Status:active
Description

Maybe I'm doing something wrong, but I can't get the module to work (Drupal 6.14, localhost/XAMPP environment). I wrote a simple module (jscontent.module) implementing hook_js to experiment with the concept:

<?php
/*
* Implementation of hook_js.
*/
function jscontent_js() {
  return array(
   
'foo' => array(
     
'callback' => 'jscontent_foo',
     
'includes' => array('theme', 'unicode'),
     
'dependencies' => array('locale', 'filter', 'user'),
    ),
  );
}

function
jscontent_foo() {
  return
"foo";
}
?>

I enabled both modules (js and jscontent), copied js.php to the root folder and edited .htaccess as described in README.TXT. Clean url's is enabled.

When I visit http://localhost/d6/js/jscontent/foo, I get Drupal's default 'page ont found' page.
When I visit http://localhost/d6/js.php?q=js/jscontent/foo, I get:

Warning: set_error_handler() expects the argument (error_handler) to be a valid callback in G:\www\d6\js.php on line 95
Fatal error: Cannot redeclare filter_xss_bad_protocol() (previously declared in G:\www\d6\js.php:131) in G:\www\d6\modules\filter\filter.module on line 1212

When I visit http://localhost/d6/js.php, I get only the fatal error above, not the warning.

Any clues? Thanks in advance.

 
 

Drupal is a registered trademark of Dries Buytaert.