From: <pdo...@us...> - 2017-06-09 10:25:29
|
Revision: 14662 http://sourceforge.net/p/squirrelmail/code/14662 Author: pdontthink Date: 2017-06-09 10:25:27 +0000 (Fri, 09 Jun 2017) Log Message: ----------- SM doesn't know how to log in again on the same connection, so best to actually close the file handle as well Modified Paths: -------------- trunk/squirrelmail/functions/imap_general.php Modified: trunk/squirrelmail/functions/imap_general.php =================================================================== --- trunk/squirrelmail/functions/imap_general.php 2017-06-09 10:22:32 UTC (rev 14661) +++ trunk/squirrelmail/functions/imap_general.php 2017-06-09 10:25:27 UTC (rev 14662) @@ -1063,8 +1063,10 @@ function sqimap_logout ($imap_stream) { /* Logout is not valid until the server returns 'BYE' * If we don't have an imap_ stream we're already logged out */ - if(isset($imap_stream) && $imap_stream) + if(isset($imap_stream) && $imap_stream) { sqimap_run_command($imap_stream, 'LOGOUT', false, $response, $message); + fclose($imap_stream); + } } /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pdo...@us...> - 2017-12-29 20:03:42
|
Revision: 14748 http://sourceforge.net/p/squirrelmail/code/14748 Author: pdontthink Date: 2017-12-29 20:03:40 +0000 (Fri, 29 Dec 2017) Log Message: ----------- Seriously? The variable is named as an array and initialized as a string? Well, I hope no callers were expecting a potentially empty string, because now they will get an empty array instead. empty() should handle this fine, hopefully callers do something sane like that. Modified Paths: -------------- trunk/squirrelmail/functions/imap_general.php Modified: trunk/squirrelmail/functions/imap_general.php =================================================================== --- trunk/squirrelmail/functions/imap_general.php 2017-12-19 05:02:38 UTC (rev 14747) +++ trunk/squirrelmail/functions/imap_general.php 2017-12-29 20:03:40 UTC (rev 14748) @@ -410,7 +410,7 @@ $read = ''; if (!is_array($message)) $message = array(); if (!is_array($response)) $response = array(); - $aResponse = ''; + $aResponse = array(); $resultlist = array(); $data = array(); $sCommand = ''; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pdo...@us...> - 2021-10-17 22:32:34
|
Revision: 14932 http://sourceforge.net/p/squirrelmail/code/14932 Author: pdontthink Date: 2021-10-17 22:32:33 +0000 (Sun, 17 Oct 2021) Log Message: ----------- Someone meant to use strlen() instead of sizeof() but neither is necessary Modified Paths: -------------- trunk/squirrelmail/functions/imap_general.php Modified: trunk/squirrelmail/functions/imap_general.php =================================================================== --- trunk/squirrelmail/functions/imap_general.php 2021-10-12 00:16:30 UTC (rev 14931) +++ trunk/squirrelmail/functions/imap_general.php 2021-10-17 22:32:33 UTC (rev 14932) @@ -1335,7 +1335,7 @@ $namespace[$ns_strings[$i]] = array(); } else { // Pop-out the first ( and last ) for easier parsing - $ns = substr($regs[$i], 1, sizeof($regs[$i])-2); + $ns = substr($regs[$i], 1, -1); if($c = preg_match_all('/\((?:(.*?)\s*?)\)/', $ns, $regs2)) { $namespace[$ns_strings[$i]] = array(); for($j=0; $j<sizeof($regs2[1]); $j++) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pdo...@us...> - 2022-05-22 22:30:14
|
Revision: 14959 http://sourceforge.net/p/squirrelmail/code/14959 Author: pdontthink Date: 2022-05-22 22:30:12 +0000 (Sun, 22 May 2022) Log Message: ----------- Fix: Login mechanisms other than "login" were broken if server returned untagged data before login response (#2854) Modified Paths: -------------- trunk/squirrelmail/functions/imap_general.php Modified: trunk/squirrelmail/functions/imap_general.php =================================================================== --- trunk/squirrelmail/functions/imap_general.php 2022-05-22 22:15:28 UTC (rev 14958) +++ trunk/squirrelmail/functions/imap_general.php 2022-05-22 22:30:12 UTC (rev 14959) @@ -908,6 +908,11 @@ $read=sqimap_fgets($imap_stream); } } + // IMAP server might return some untagged info before + // the tagged login command response - skip over that + while ($read[0] === '*') { + $read = sqimap_fgets($imap_stream); + } $results=explode(" ",$read,3); $response=$results[1]; $message=$results[2]; @@ -936,7 +941,7 @@ * credentials and use that as the authorization identity. */ $tag=sqimap_session_id(false); - $sasl = (isset($sqimap_capabilities['SASL-IR']) && $sqimap_capabilities['SASL-IR']) ? true : false; + $sasl = sqimap_capability($imap_stream, 'SASL-IR'); if(!empty($authz)) { $auth = base64_encode("$username\0$authz\0$password"); } else { @@ -957,6 +962,11 @@ $read = sqimap_fgets($imap_stream); } } + // IMAP server might return some untagged info before + // the tagged login command response - skip over that + while ($read[0] === '*') { + $read = sqimap_fgets($imap_stream); + } $results=explode(" ",$read,3); $response=$results[1]; $message=$results[2]; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pdo...@us...> - 2024-06-01 21:21:58
|
Revision: 15019 http://sourceforge.net/p/squirrelmail/code/15019 Author: pdontthink Date: 2024-06-01 21:21:55 +0000 (Sat, 01 Jun 2024) Log Message: ----------- Correct docs, initialize variable Modified Paths: -------------- trunk/squirrelmail/functions/imap_general.php Modified: trunk/squirrelmail/functions/imap_general.php =================================================================== --- trunk/squirrelmail/functions/imap_general.php 2024-06-01 21:20:41 UTC (rev 15018) +++ trunk/squirrelmail/functions/imap_general.php 2024-06-01 21:21:55 UTC (rev 15019) @@ -1208,7 +1208,7 @@ * @param stream $imap_stream * @param string $capability (since 1.3.0) * @param boolean $bUseCache (since 1.5.1) Controls use of capability data stored in session - * @return mixed (string if $capability is set and found, + * @return mixed (string or array if $capability is set and found (array in the case the capability has multiple options), * false, if $capability is set and not found, * array if $capability not set) */ @@ -1216,6 +1216,7 @@ // sqgetGlobalVar('sqimap_capabilities', $sqimap_capabilities, SQ_SESSION); if (!$bUseCache || ! sqgetGlobalVar('sqimap_capabilities', $sqimap_capabilities, SQ_SESSION)) { + $sqimap_capabilities = array(); $read = sqimap_run_command($imap_stream, 'CAPABILITY', true, $a, $b); $c = explode(' ', $read[0]); for ($i=2; $i < count($c); $i++) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |