Make WordPress Core

Ticket #3807: pluggable.php.diff

File pluggable.php.diff, 1.0 KB (added by basvd, 18 years ago)

Works around Suhosin cookie encryption, which is causing the problem.

Line 
1374,379c374,386
2<       $cookie = explode('; ', urldecode(empty($_POST['cookie']) ? $_GET['cookie'] : $_POST['cookie'])); // AJAX scripts must pass cookie=document.cookie
3<       foreach ( $cookie as $tasty ) {
4<               if ( false !== strpos($tasty, USER_COOKIE) )
5<                       $user = substr(strstr($tasty, '='), 1);
6<               if ( false !== strpos($tasty, PASS_COOKIE) )
7<                       $pass = substr(strstr($tasty, '='), 1);
8---
9>       // Suhosin workaround
10>       $dough = ini_get('suhosin.cookie.encrypt');
11>       if ( 1 == $dough || 'On' == $dough || 'on' == $dough ) {
12>               $user = $_COOKIE[USER_COOKIE];
13>               $pass = $_COOKIE[PASS_COOKIE];
14>       } else {
15>               $cookie = explode('; ', urldecode(empty($_POST['cookie']) ? $_GET['cookie'] : $_POST['cookie'])); // AJAX scripts must pass cookie=document.cookie
16>               foreach ( $cookie as $tasty ) {
17>                       if ( false !== strpos($tasty, USER_COOKIE) )
18>                               $user = substr(strstr($tasty, '='), 1);
19>                       if ( false !== strpos($tasty, PASS_COOKIE) )
20>                               $pass = substr(strstr($tasty, '='), 1);
21>               }