Welcome, Guest. Register Now!
   
Mark Forums Read Mark Forums Read Mark Forums Read


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 11-06-2007, 11:19 PM
3dB 3dB is offline
Junior Member
 
Join Date: Nov 2007
Posts: 1
Default Zend Controller Escaping Post Array

Hey guys,

Here's a crazy one:
This is the first application I've ever developed with the Zend Framework. I'm having a problem with the Zend Controller escaping my $_POST array. I know that it is something within the controller doing it because if I put a line in my bootstrap file to print out a variable from the array, the results are not escaped. I'm not too sure how to diagnose exactly what is doing this.

Here's what my bootstrap looks like:
Code:
//Start the stopwatch
global $stopwatch;
$stopwatch  = microtime(true);

//Set error reporting
error_reporting( E_ALL | E_STRICT );

//Always set your timezone when working with dates!
date_default_timezone_set('America/New_York');

//Magic quotes suck
ini_set('magic_quotes_gpc', 'Off');
ini_set('magic_quotes_runtime', 'Off');
ini_set('magic_quotes_sybase', 'Off');

//Setup Zend autoloading
require_once 'Zend/Loader.php';
Zend_Loader::registerAutoload();

//Setup a variable to point to the application directory
$appDir = dirname(dirname(__FILE__)) . '/application';

//Add the models directory to the include path
set_include_path(
    $appDir . '/models'
    . PATH_SEPARATOR
    . get_include_path()
);

//Register our configuration file
$config = new Zend_Config_Ini("$appDir/etc/config.ini", 'main');
Zend_Registry::set('config', $config);

//Set error reporting output to the browser from the config
ini_set('display_errors', $config->display->errors);

//Setup and register our logger
try {
        $writer = new Zend_Log_Writer_Stream($config->log->path);
        $logger = new Zend_Log($writer);
        Zend_Registry::set('logger', $logger);
} catch (Zend_Exception $e) {
        print "<!-- LOG ERROR -->\n\n";
}

//Setup the database and register it
try {
        $db = Zend_Db::factory(
            $config->database->adapter,
            $config->database->params->toArray()
        );
        $db->setFetchMode(Zend_Db::FETCH_OBJ);
        $db->query('SET NAMES utf8');
} catch (Zend_Db_Adapter_Exception $e) {
        $logger->alert('RDBMS connect failure.');
        die("MySQL Connection Error- RDBMS connect failure. This would be the appropriate time for an \"uguu\"...");
} catch (Zend_Exception $e) {
        $logger->alert('Zend exception in RDBMS connect.');
        die("MySQL Connection Error- Zend Exception. We're all gonna die!");
}
Zend_Registry::set('database', $db);


//============================================================
//Front end controller setup

//Instantiate the front router
$cntrl = Zend_Controller_Front::getInstance();

//Set the controller to throw exceptions
$cntrl->throwExceptions(true);

//Get our router instance
$router = $cntrl->getRouter();

//Create new routes
//Static routes
$route = new Zend_Controller_Router_Route_Static(
        'faq',
        array('controller' => 'index', 'action' => 'faq')
);
$router->addRoute('faq', $route);
$route = new Zend_Controller_Router_Route_Static(
        'about',
        array('controller' => 'index', 'action' => 'about')
);
$router->addRoute('about', $route);

//Dispatch the controller
try {
        $cntrl->run($appDir . '/controllers');
} catch (Zend_Exception $e) {
        include('404.phtml');
        exit();
}
Has anybody seen anything like this previously? As you can see, magic quotes have clearly been turned off, and they are also set to off in my php.ini file. I'm kind of at a loss as to what to do.

Thanks in advance for your help!
-- 3dB
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 11:53 PM.