svncommit
2008-04-20 653242c6634061f028b48ca03b630d28f7a902f7
Fix parse_attrib_string to handle unquoted attribute values

2 files modified
17 ■■■■ changed files
CHANGELOG 5 ●●●●● patch | view | raw | blame | history
program/include/main.inc 12 ●●●●● patch | view | raw | blame | history
CHANGELOG
@@ -1,6 +1,11 @@
CHANGELOG RoundCube Webmail
---------------------------
2008/04/20 (estadtherr)
----------
- fix parse_attrib_string to handle unquoted values, which fixes
  display issues with HTML messages that do not quote attributes
2008/04/17 (alec)
----------
- Fix IMAP response in message body when message has no body (#1484964)
program/include/main.inc
@@ -391,7 +391,7 @@
/**
 * Return correct name for a specific database sequence
 * (used for Postres only)
 * (used for Postgres only)
 *
 * @param string Secuence name
 * @return string Translated sequence name
@@ -1483,12 +1483,14 @@
function parse_attrib_string($str)
  {
  $attrib = array();
  preg_match_all('/\s*([-_a-z]+)=(["\'])([^"]+)\2/Ui', stripslashes($str), $regs, PREG_SET_ORDER);
  preg_match_all('/\s*([-_a-z]+)=(["\'])??(?(2)([^"\']+)\2|(\S+?))/Ui', stripslashes($str), $regs, PREG_SET_ORDER);
  // convert attributes to an associative array (name => value)
  if ($regs)
    foreach ($regs as $attr)
      $attrib[strtolower($attr[1])] = $attr[3];
      {
      $attrib[strtolower($attr[1])] = $attr[3] . $attr[4];
      }
  return $attrib;
  }
@@ -1633,8 +1635,8 @@
 * Append a line to a logfile in the logs directory.
 * Date will be added automatically to the line.
 *
 * @param $name Name of logfile
 * @param $line Line to append
 * @param $name name of log file
 * @param line Line to append
 */
function write_log($name, $line)
  {