zend-framework

SQL injection and XSS protection in PHP combining Code Ignitors xss_clean() and Zend PDO

杀马特。学长 韩版系。学妹 提交于 2019-12-11 16:33:01
问题 I am in search of a function that will secure All DB queries from MOST of the common threats and attacks. its like combining the classes of CI and Zend with putting custom code to have a fully customized security function. 来源: https://stackoverflow.com/questions/7753982/sql-injection-and-xss-protection-in-php-combining-code-ignitors-xss-clean-and

install WordPress with Zend, use Zend_Auth to allow view WordPress Posts

落爺英雄遲暮 提交于 2019-12-11 16:16:59
问题 This might be easy to accomplish but I stuck ... I had this Zend application installed on http://www.example.com using Zend_Auth to identify if user can see the rest of the page. So I have code like if (!Zend_Auth::getInstance()->hasIdentity()) { $this->_helper->redirector('login', 'login'); } Now I Install WordPress under http://www.example.com/blog/ And using .htaccess to allow access to the blog as below and the same time, zend application can work RewriteRule ^blog - [NC,L] RewriteRule ^.

Zend_Http_Client POST 'missing required parameters'

谁说胖子不能爱 提交于 2019-12-11 15:57:44
问题 First of all, I looked at this question and tried the solution, did not work for me. I am working in Zend 1.12 on a PHP 7.0.22 server. I have a function that should post data to an API and receive a confirmation of the post. Whenever I test it in my rest client, in firefox, I get this response from the API call: "{\"code\":400,\"text\":\"Missing required parameters.\"}" . When I add a header: Content-Type: application/x-www-form-urlencoded I get the expected respone: '200, true' . But even

How to remove radio button default checked in zend

淺唱寂寞╮ 提交于 2019-12-11 15:49:22
问题 HI guys i am trying to remove the default checked value for radio button Here is my code: <?php if ($this->isAllowed('order.customer.ticket-details')) : ?> <fieldset class="order-obv-ticket"> <legend><?php echo $this->translate('order_obv_ticket'); ?></legend> <div id="order-ticket-details"></div> </fieldset> <?php endif;?> Here is my js function: function getOrderTicketDetails(orderId, contactId) { $.ajax({ url: vbdURL+'/order/customer/ticket-details', data:{orderId : orderId, contactId :

Server displays old version of site

旧巷老猫 提交于 2019-12-11 15:47:02
问题 Good day to all. I have a site (created with zend framework and smarty) hosted on a virtual machine (vmware) with centOS 5.2. Everything worked fine for about 2 month, but a problem occurred now. I am trying to modify some .tpl files and after I save and upload on server (the one on the virtual machine) the server gives me the old version of the page. Already cleared cache, change browser, etc... is not browser related. I tried on different computers and all have the same result. I also

PHPUnit showing passed methods that throws Fatal Error Exception

萝らか妹 提交于 2019-12-11 15:44:49
问题 I am having problem with PHPUnit on Netbeans where few methods are showing as passed when the method throws some exception like Fatal error or something. So it seems that PhpUnit cannot handle these exception and it just marks them as passed. This would work fine $this->assertEquals(true, 1 == 2); Failed asserting that false matches expected true. but if I add some code that throws some exception then it just marks it as passed as an example: public function testEquals() {

Catching Exceptions in Zend Framework 3

独自空忆成欢 提交于 2019-12-11 15:43:01
问题 I use the ZF3 skeletion application. I wonder where I am supposed to catch exceptions globally. Example: Right now, if I access an invalid route (mysite.com/invalid-route), the application reports an uncaught expection and HTTP response code 200 Fatal error: Uncaught Zend\View\Exception\RuntimeException: No RouteMatch instance provided I would expect the build-in 404 error page to be triggered. What am I missing? Can someone point me to the right direction? The exception is logged properly

Zendframework 3 - Can't get entityManager on Application/Module

浪尽此生 提交于 2019-12-11 15:33:45
问题 I use Zendframework 3 and I have followed the tutorial for User authentication. In this project I'm able to connect to my database using entityManager. Then I created another project and copied the required code to make ORM work but I'm not able to retrieve information. I have read my code 1000 time, no error in log, every factory is correctly mapped. Here's my configuration: composer.json { "name": "zendframework/skeleton-application", "description": "Skeleton Application for Zend Framework

Zend_Auth login using either username or email as identityColumn

怎甘沉沦 提交于 2019-12-11 15:32:19
问题 I'm using Zend_Auth with a "Database Table Authentication". What I want to do is allow the user to login with either a username or email address as the "identityColumn". How would I allow both. I'm stuck. 回答1: Extend and implement your own Auth Adapter and use query like "WHERE username = ? or email = ?" to get Auth result :) 回答2: Authenticate twice (if needed) with 2 different Zend_Auth_Adapter_DbTable objects and add some logic to determine if the login is username or email by guessing if

Set Zend_Date Month using User Input

别等时光非礼了梦想. 提交于 2019-12-11 15:32:05
问题 I'm looking for a way to set the month of Zend_Date using a string from the user (could be Jan, January, etc). For example $month = strftime("%m", strtotime($month)); $date->set($month, Zend_Date::MONTH); Will get the month 'number', which then can be used to set the Zend_Date month. Is there a way to do that all with Zend_Date? 回答1: $month = 'January'; // Or 'Jan' or 1 or '1' or '01' $date->setMonth($month); 来源: https://stackoverflow.com/questions/1545737/set-zend-date-month-using-user-input