English 中文(简体)
失踪500.shtml
原标题: Missing 500.shtmlController when submit a form with the words "select" and "from" in any text-box in CakePHP

This one threw me for a loop - not even sure where to start looking.

If you submit a form in my CakePHP application with the words "select" and "from" in any text area, it errors out:

Missing Controller

Error: 500.shtmlController could not be found.

Error: Create the class 500.shtmlController below in file: app/controllers/500.shtml_controller.php

<?php
    class 500.shtmlController extends AppController {
        var $name =  500.shtml ;
    }
?>

Notice: If you want to customize this error message, create app/views/errors/missing_controller.ctp

即便是“从一度中挑选出的真主党”,也会出现错误。 BUT——如果你按相反顺序排列,它就不是一个问题——你CAN的类型是“从选定的真主党......”的,它没有问题。

I m using the jquery validator plugin (but I have to assume it s not on the javascript side - seems like it must be something w/ Cake / MySQL?)

纽约市协会非常欢迎。

最佳回答

Do you have ModSecurity installed on Apache? It looks like your string triggers its pattern:

(insert[[:space:]]+into.+values|select.*from.+[a-z|A-Z|0-9]|select.+from|bulk[[:space:]]+insert|union.+select|convert.+\(.*from)

看一看像<条码>。 安保部: 在您的错误记录中拒绝使用代码500(第2阶段)

And it looks like you ve disabled default Pages route:

Router::connect( /pages/* , array( controller  =>  pages ,  action  =>  display ));

因此,Cake试图将域.com/500.shtml至500.shtmlController

问题回答

这实际上是两个问题。

  1. Your rewrite rules aren t working quite right if they re trying to pass a request for the "static" page 500.shtml to Cake. Make sure that your .htaccess files are in place and that Apache is configured with AllowOverride so that the .htaccess files can do their job properly.
  2. Something is screwy with the code causing an internal server error when processing your posted data. To troubleshoot this, we ll need to see the code that you re POSTing to. Revise your question to include the relevant controller code.

前往CakePHP1.3。 我认为你正在使用CakePHP 1.1。





相关问题
SQL SubQuery getting particular column

I noticed that there were some threads with similar questions, and I did look through them but did not really get a convincing answer. Here s my question: The subquery below returns a Table with 3 ...

please can anyone check this while loop and if condition

<?php $con=mysql_connect("localhost","mts","mts"); if(!con) { die( unable to connect . mysql_error()); } mysql_select_db("mts",$con); /* date_default_timezone_set ("Asia/Calcutta"); $date = ...

php return a specific row from query

Is it possible in php to return a specific row of data from a mysql query? None of the fetch statements that I ve found return a 2 dimensional array to access specific rows. I want to be able to ...

Character Encodings in PHP and MySQL

Our website was developed with a meta tag set to... <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> This works fine for M-dashes and special quotes, etc. However, I ...

Pagination Strategies for Complex (slow) Datasets

What are some of the strategies being used for pagination of data sets that involve complex queries? count(*) takes ~1.5 sec so we don t want to hit the DB for every page view. Currently there are ~...

Averaging a total in mySQL

My table looks like person_id | car_id | miles ------------------------------ 1 | 1 | 100 1 | 2 | 200 2 | 3 | 1000 2 | 4 | 500 I need to ...

热门标签