Commit 49266827 authored by ilya's avatar ilya

MDL-70298 lib_horde: Upgrade Horde library to 5.2.23

parent ed240045
...@@ -88,6 +88,9 @@ class Horde_Idna ...@@ -88,6 +88,9 @@ class Horde_Idna
*/ */
protected static function _checkForError($info) protected static function _checkForError($info)
{ {
if (!isset($info['errors'])) {
return;
}
switch (true) { switch (true) {
case $info['errors'] & IDNA_ERROR_EMPTY_LABEL: case $info['errors'] & IDNA_ERROR_EMPTY_LABEL:
throw new Horde_Idna_Exception(Horde_Idna_Translation::t( throw new Horde_Idna_Exception(Horde_Idna_Translation::t(
......
...@@ -120,6 +120,53 @@ class Horde_Imap_Client_Data_Thread implements Countable, Serializable ...@@ -120,6 +120,53 @@ class Horde_Imap_Client_Data_Thread implements Countable, Serializable
return array(); return array();
} }
/**
* Returns array of all threads.
*
* @return array Keys of thread arrays are indices, values are objects with the following
* properties:
* - base: (integer) Base ID of the thread. If null, thread is a single
* message.
* - last: (boolean) If true, this is the last index in the sublevel.
* - level: (integer) The sublevel of the index.
*/
public function getThreads()
{
$data = array();
foreach ($this->_thread as $v) {
reset($v);
$ob = new stdClass;
$ob->base = (count($v) > 1) ? key($v) : null;
$ob->last = false;
$levels = $out = array();
$last = 0;
while (($v2 = current($v)) !== false) {
$k2 = key($v);
$ob2 = clone $ob;
$ob2->level = $v2;
$out[$k2] = $ob2;
if (($last < $v2) && isset($levels[$v2])) {
$out[$levels[$v2]]->last = true;
}
$levels[$v2] = $k2;
$last = $v2;
next($v);
}
foreach ($levels as $v) {
$out[$v]->last = true;
}
$data[] = $out;
}
return $data;
}
/* Countable methods. */ /* Countable methods. */
/** /**
......
...@@ -595,7 +595,7 @@ class Horde_Imap_Client_Search_Query implements Serializable ...@@ -595,7 +595,7 @@ class Horde_Imap_Client_Search_Query implements Serializable
* Search for text in either the entire message, or just the body. * Search for text in either the entire message, or just the body.
* *
* @param string $text The search text. * @param string $text The search text.
* @param string $bodyonly If true, only search in the body of the * @param boolean $bodyonly If true, only search in the body of the
* message. If false, also search in the headers. * message. If false, also search in the headers.
* @param boolean $not If true, do a 'NOT' search of $text. * @param boolean $not If true, do a 'NOT' search of $text.
* @param array $opts Additional options: * @param array $opts Additional options:
......
...@@ -1543,12 +1543,9 @@ class Horde_Imap_Client_Socket extends Horde_Imap_Client_Base ...@@ -1543,12 +1543,9 @@ class Horde_Imap_Client_Socket extends Horde_Imap_Client_Base
/* Add in STATUS return, if needed. */ /* Add in STATUS return, if needed. */
if (!empty($options['status']) && $this->_capability('LIST-STATUS')) { if (!empty($options['status']) && $this->_capability('LIST-STATUS')) {
foreach ($pattern as $val) { foreach($lr as $val_utf8 => $tmp) {
$val_utf8 = Horde_Imap_Client_Utf7imap::Utf7ImapToUtf8($val); $lr[$val_utf8]['status'] = $this->_prepareStatusResponse($status_opts, $val_utf8);
if (isset($lr[$val_utf8])) { }
$lr[$val_utf8]['status'] = $this->_prepareStatusResponse($status_opts, $val_utf8);
}
}
} }
return $lr; return $lr;
......
...@@ -110,7 +110,7 @@ class Horde_Imap_Client_Socket_ClientSort ...@@ -110,7 +110,7 @@ class Horde_Imap_Client_Socket_ClientSort
} }
$mbox = $this->_socket->currentMailbox(); $mbox = $this->_socket->currentMailbox();
$fetch_res = $this->_socket->fetch($mbox['mailbox'], $query, array( $fetch_res = $this->_socket->fetch(isset($mbox['mailbox']) ? $mbox['mailbox'] : null, $query, array(
'ids' => $res 'ids' => $res
)); ));
......
...@@ -394,10 +394,10 @@ class Horde_Mime_Mail ...@@ -394,10 +394,10 @@ class Horde_Mime_Mail
/** /**
* Sends this message. * Sends this message.
* *
* @param Mail $mailer A Mail object. * @param Horde_Mail_Transport $mailer A Horde_Mail_Transport object.
* @param boolean $resend If true, the message id and date are re-used; * @param boolean $resend If true, the message id and date are re-used;
* If false, they will be updated. * If false, they will be updated.
* @param boolean $flowed Send message in flowed text format. * @param boolean $flowed Send message in flowed text format.
* *
* @throws Horde_Mime_Exception * @throws Horde_Mime_Exception
*/ */
...@@ -488,7 +488,7 @@ class Horde_Mime_Mail ...@@ -488,7 +488,7 @@ class Horde_Mime_Mail
* @param boolean $stream If true, return a stream resource, otherwise * @param boolean $stream If true, return a stream resource, otherwise
* a string is returned. * a string is returned.
* *
* @return stream|string The raw email data. * @return resource|string The raw email data.
* @since 2.4.0 * @since 2.4.0
*/ */
public function getRaw($stream = true) public function getRaw($stream = true)
......
...@@ -91,7 +91,7 @@ class Client ...@@ -91,7 +91,7 @@ class Client
$secure = false; $secure = false;
} }
$context = array_merge_recursive( $context = array_replace_recursive(
array( array(
'ssl' => array( 'ssl' => array(
'verify_peer' => false, 'verify_peer' => false,
......
...@@ -114,7 +114,7 @@ class Horde_Util ...@@ -114,7 +114,7 @@ class Horde_Util
public static function dispelMagicQuotes($var) public static function dispelMagicQuotes($var)
{ {
if (is_null(self::$_magicquotes)) { if (is_null(self::$_magicquotes)) {
self::$_magicquotes = get_magic_quotes_gpc(); self::$_magicquotes = function_exists('get_magic_quotes_gpc') && @get_magic_quotes_gpc();
} }
if (self::$_magicquotes) { if (self::$_magicquotes) {
...@@ -304,7 +304,7 @@ class Horde_Util ...@@ -304,7 +304,7 @@ class Horde_Util
/* Get the first 8 characters of a random string to use as a temporary /* Get the first 8 characters of a random string to use as a temporary
directory name. */ directory name. */
do { do {
$new_dir = $temp_dir . '/' . substr(base_convert(uniqid(mt_rand()), 10, 36), 0, 8); $new_dir = $temp_dir . '/' . substr(base_convert(uniqid(mt_rand()), 16, 36), 0, 8);
} while (file_exists($new_dir)); } while (file_exists($new_dir));
$old_umask = umask(0000); $old_umask = umask(0000);
......
...@@ -12,10 +12,6 @@ Description of import of Horde libraries ...@@ -12,10 +12,6 @@ Description of import of Horde libraries
# Copy the following script and store it on /tmp, change it's execute bit(chmod 777), and run it, # Copy the following script and store it on /tmp, change it's execute bit(chmod 777), and run it,
passing in your path to Horde (the directory you've cloned the repository): passing in your path to Horde (the directory you've cloned the repository):
/tmp/copyhorde.sh ~/git/base/directory/from/step/2 /tmp/copyhorde.sh ~/git/base/directory/from/step/2
# Verify that these patches have been applied in the imported version. Apply them locally if not:
- https://github.com/horde/Mail/pull/1 (Mail component).
- https://github.com/horde/Imap_Client/pull/6 (IMAP Client component).
- https://github.com/horde/Crypt_Blowfish/pull/1 (PHP 7.4 compatibility, Crypt_Blowfish)
==== ====
#!/bin/sh #!/bin/sh
......
...@@ -179,7 +179,7 @@ ...@@ -179,7 +179,7 @@
<location>horde</location> <location>horde</location>
<name>Horde</name> <name>Horde</name>
<license>LGPL/BSD</license> <license>LGPL/BSD</license>
<version>5.2.22</version> <version>5.2.23</version>
<licenseversion>2.1</licenseversion> <licenseversion>2.1</licenseversion>
</library> </library>
<library> <library>
......
...@@ -2,6 +2,7 @@ This files describes API changes in core libraries and APIs, ...@@ -2,6 +2,7 @@ This files describes API changes in core libraries and APIs,
information provided here is intended especially for developers. information provided here is intended especially for developers.
=== 3.11 === === 3.11 ===
* The horde library has been updated to version 5.2.23.
* New optional parameter $extracontent for print_collapsible_region_start(). This allows developers to add interactive HTML elements * New optional parameter $extracontent for print_collapsible_region_start(). This allows developers to add interactive HTML elements
(e.g. a help icon) after the collapsible region's toggle link. (e.g. a help icon) after the collapsible region's toggle link.
* Final deprecation i_dock_block() in behat_deprecated.php * Final deprecation i_dock_block() in behat_deprecated.php
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment