草庐IT

browser-security

全部标签

php - Zend_Session : Session must be started before any output has been sent to the browser

我以前遇到过这个问题,但我不记得如何解决它。我已经创建了一个基本的(再简单不过了)Controller,我只是想向浏览器回显一些东西,我收到了这条消息:Fatalerror:Uncaughtexception'Zend_Session_Exception'withmessage'Sessionmustbestartedbeforeanyoutputhasbeensenttothebrowser...这是我的整个Controller。它显示“成功”,但也显示错误消息。我怎样才能使该错误消息静音,以便我可以简单地向浏览器回显一些内容?_helper->layout->disableLayo

PHP session.cookie_secure : Disables sessions when set to true

当我设置以下配置时:ini_set("session.cookie_secure",1);我的整个应用程序的session已禁用,我无法再写入或读取session变量。$sessionName="us";session_name($sessionName);ini_set('session.cookie_httponly',1);ini_set('session.entropy_file','/dev/urandom');ini_set('session.hash_function','whirlpool');ini_set('session.use_only_cookies',1);

PHP get_browser() 返回奇怪的值

我想使用:publicfunctionBrowserCheck(){static$Browser;if(!isset($Browser)){$Browser=get_browser($_SERVER['HTTP_USER_AGENT'],true);}return$Browser;}根据http://de3.php.net/manual/de/function.get-browser.php上的建议,但不知何故var_dump($Result);只会输出奇怪的值:array(30){["browser_name_regex"]=>string(6)"§^.*$§"["browser_n

security - Symfony2 http_basic 安全拒绝有效凭据

我使用SymfonyStandard2.0.0BETA1并尝试配置与thisbookchapter中完全相同的http_basic身份验证security:encoders:Symfony\Component\Security\Core\User\User:plaintextproviders:main:users:foo:{password:testing,roles:ROLE_USER}firewalls:main:pattern:/.*http_basic:truelogout:trueaccess_control:-{path:/.*,role:ROLE_USER}问题是当我尝

php - 在 "security"代码拧紧后重置发布数据

我继承了一个古老而复杂的系统,该系统会及时更换,但现在我有一个主要问题。(加密的,耶!)初始化代码中的某处是与GPC变量混在一起的代码,应用诸如addslashes和htmlspecialchars之类的东西而不考虑任何类型的上下文.你知道的,绝对是小蛋糕会做的那种事情。不是您期望从有点昂贵的PHP软件中得到的东西。不管怎么说,有什么方法可以强制PHP重新读取请求的POST数据并从中重新填充$_POST吗?我已经尝试了gotogo-to方法file_get_contents("php://input");但返回空白-大概是init代码读取它,因为在旧版本的PHP中它只能读取一次....

php - "proc_open() has been disabled for security reasons"- PHP 错误

proc_open()hasbeendisabledforsecurityreasons我目前正在免费托管(Hostinger)-制作个人网站仅供我和其他一些人使用。我知道我应该从php.ini中删除proc_open,但由于我的共享主机计划,我无法访问它。我的代码中围绕proc_open的代码如下-如果您需要完整代码,请告诉我。我试过注释部分但它返回错误。我只想删除它并允许代码正常运行。=1?true:false;//Commandexecutionfunctionexecute_command($command){$descriptors=array(0=>array('pipe'

php - 如何编写 mod_security 友好的 PHP 代码?

我在WordPress中创建了一个主题,该主题在HostGator上触发了mod_security规则并给出了403错误。我联系了那里的人(在HostGator),他们帮我修好了。但我不希望我的主题像这样工作。我只是想知道是否有关于编写对mod_security友好的PHP代码的指南/博客文章/教程?我试过谷歌,但没有找到任何有用的东西。 最佳答案 我不确定是否有很多指南,特别是因为mod_security配置因服务器而异。我最推荐的是看一下CoreRuleSetProject.那里有很多规则。他们有很多。一些一般要避免的事情是:在

php - 身份验证凭证未找到异常 : The security context contains no authentication token

我收到以下错误AuthenticationCredentialsNotFoundException:Thesecuritycontextcontainsnoauthenticationtoken.OnepossiblereasonmaybethatthereisnofirewallconfiguredforthisURL.我已经尝试过解决方案,因为我知道当没有为路由配置安全防火墙时会发生此错误,但我似乎无法解决该错误。这是我的security.ymlsecurity:access_decision_manager:#strategycanbe:affirmative,unanimous

php - 大文件上传时的 Apache 错误 500 (mod_security)

就我所尝试的而言,常用的解决方案都不适合我。好吧,我的问题是,每次我上传“大文件”(600KB~)时都会收到500错误,而较小的图像效果很好。所以...,即使使用这个(极端的).htaccess文件,它也会继续发生,是的,.htaccess是事件的:upload_max_filesize=100Mpost_max_size=100Mmemory_limit=128Mmax_input_time=6000max_execution_time=6000因此,我查看了日志并发现了这一点(只有一行,只是将其粘贴为易于阅读并带有行跳转):[MonJul2717:09:28.2015][:erro

php - puppet : How to stop from PHP code printing in browser window

为了学习,我尝试在Vagrant上使用Puppet提供一个PHPWeb服务器。但是,我在浏览器窗口中获取PHP代码转储,而不是执行。我曾尝试寻找解决问题的方法,但在这里找不到。任何帮助将不胜感激。这是我到目前为止所做的。puppetmaster/manifests/site.ppnode/^puppet/{includepuppetmaster}node/^web/{includewebserverincludephp}puppetmaster/module/webserver/manifests/init.pp(自定义模块)classwebserver{notify{"provisi