suhosin

CakePHP Cookies getting scrambled - Suhosin related

ⅰ亾dé卋堺 提交于 2020-01-13 09:01:41
问题 For some reason I am unable to read any cookies from my CakePHP app on any page after they have been set, the only thing that is returned is garbled text. My code is as simple as this: $this->Cookie->write('Region', 'test'); $reg = $this->Cookie->read('Region'); pr($reg); I uncomment the $this->Cookie->write() line and all I get back is a bunch of random control characters. I also recently upgraded to CakePHP 1.3 but AFAIK this should not effect cookie like this... This was working fine until

How to override suhosin max value?

微笑、不失礼 提交于 2019-12-22 21:24:02
问题 An important GET param is being filtered by suhosin. How do I override suhosin when the following does not work? public_html/php.ini : [suhosin] suhosin.get.max_value_length = 2048 Sets suhosin.get.max_value_length among others to NULL and crashes user session. - public_html/.htaccess : <IfModule mod_php5.c> php_value suhosin.get.max_value_length 2048 </IfModule> No effect - (System default is set to:) suhosin.get.max_value_length = 512 suhosin.get.max_value_length = 100000 The GET parameter

How to override suhosin max value?

扶醉桌前 提交于 2019-12-22 21:22:46
问题 An important GET param is being filtered by suhosin. How do I override suhosin when the following does not work? public_html/php.ini : [suhosin] suhosin.get.max_value_length = 2048 Sets suhosin.get.max_value_length among others to NULL and crashes user session. - public_html/.htaccess : <IfModule mod_php5.c> php_value suhosin.get.max_value_length 2048 </IfModule> No effect - (System default is set to:) suhosin.get.max_value_length = 512 suhosin.get.max_value_length = 100000 The GET parameter

How to override suhosin max value?

寵の児 提交于 2019-12-22 21:22:15
问题 An important GET param is being filtered by suhosin. How do I override suhosin when the following does not work? public_html/php.ini : [suhosin] suhosin.get.max_value_length = 2048 Sets suhosin.get.max_value_length among others to NULL and crashes user session. - public_html/.htaccess : <IfModule mod_php5.c> php_value suhosin.get.max_value_length 2048 </IfModule> No effect - (System default is set to:) suhosin.get.max_value_length = 512 suhosin.get.max_value_length = 100000 The GET parameter

Can't upload 5mb file using AJAX file uploader

醉酒当歌 提交于 2019-12-21 23:37:58
问题 I am using the file uploader plugin (from: https://github.com/valums/file-uploader) to upload files to my website. If you are using a moden web browser (like Firefox 6 or Chrome 13), then it uploads by streaming the file in the POST body, and can give you a progress bar. If you're using IE (or an old browser), it falls back on the standard $_FILES (using a hidden iFrame). Everything was working fine, but suddenly I can't upload 5MB files in Chrome or Firefox. When I upload a 5MB file in Chome

Workaround for suhosin.mt_srand.ignore to consistently shuffle an array in PHP?

两盒软妹~` 提交于 2019-12-10 16:33:41
问题 I have a PHP script which needs to randomise an array with consistent results, so it can present the first few items to the user and they can then pull in more results from the same shuffled set if they want to. What I'm currently using is this (based on the Fisher Yates algorithm I believe): function shuffle(&$array, $seed) { mt_srand($seed); for ($a=count($array)-1; $a>0; $a--) { $b = mt_rand(0, $a); $temp = $array[$a]; $array[$a] = $array[$b]; $array[$b] = $temp; } } Which works fine on my

Security with PHP Sessions

醉酒当歌 提交于 2019-12-09 05:45:15
问题 I know this has been asked billions of times, but I'm super paranoid/OCD about the security of my coding. I'm working on a little project. The session data will only contain: user_id 1 user_name MyUsername logged_in true csrf_token 87cc51ee94178df79cccce2aebc45d53 Here's my code. Is it secure enough to use on a small CMS? session_start(); ini_set('session.cookie_httponly', 'On'); ini_set('session.cookie_secure', 'On'); ini_set('session.use_cookies', 'On'); ini_set('session.use_only_cookies',

CakePHP Cookies getting scrambled - Suhosin related

流过昼夜 提交于 2019-12-05 04:34:05
For some reason I am unable to read any cookies from my CakePHP app on any page after they have been set, the only thing that is returned is garbled text. My code is as simple as this: $this->Cookie->write('Region', 'test'); $reg = $this->Cookie->read('Region'); pr($reg); I uncomment the $this->Cookie->write() line and all I get back is a bunch of random control characters. I also recently upgraded to CakePHP 1.3 but AFAIK this should not effect cookie like this... This was working fine until I changed server , this must be the root of my problem. Update After probing around further I have

Can't upload 5mb file using AJAX file uploader

廉价感情. 提交于 2019-12-04 19:17:28
I am using the file uploader plugin (from: https://github.com/valums/file-uploader ) to upload files to my website. If you are using a moden web browser (like Firefox 6 or Chrome 13), then it uploads by streaming the file in the POST body, and can give you a progress bar. If you're using IE (or an old browser), it falls back on the standard $_FILES (using a hidden iFrame). Everything was working fine, but suddenly I can't upload 5MB files in Chrome or Firefox. When I upload a 5MB file in Chome or Firefox I get a 500 error and my PHP code is never even ran. If I use Internet Explorer (which

Query variable can be no longer than 512 characters

孤人 提交于 2019-12-02 07:19:58
问题 I'm struggling to read query variables that contain more than 512 characters in the $_GET array. If I parse the query string using parse_string , however, I can read it just fine from the resulting array. Example: # GET /test.php?foo=<string with 513 characters>&bar=bar HTTP/1.1 <?php var_dump($_GET['foo']); # NULL var_dump($_GET['bar']); # "bar" parse_str($_SERVER['QUERY_STRING'], $output); var_dump($output['foo']); # <string with 513 characters> ?> This makes no sense to me, since $_GET