summaryrefslogtreecommitdiff
path: root/program
diff options
context:
space:
mode:
authorsvncommit <devs@roundcube.net>2008-04-20 22:49:15 +0000
committersvncommit <devs@roundcube.net>2008-04-20 22:49:15 +0000
commit653242c6634061f028b48ca03b630d28f7a902f7 (patch)
tree42ad37ab2542744558f8f2f9ec6fe15541a8b936 /program
parentea090ca09d2ee04c68c524f0e3c63de2fdb21a04 (diff)
Fix parse_attrib_string to handle unquoted attribute values
Diffstat (limited to 'program')
-rw-r--r--program/include/main.inc20
1 files changed, 11 insertions, 9 deletions
diff --git a/program/include/main.inc b/program/include/main.inc
index b5004e899..2abe70438 100644
--- a/program/include/main.inc
+++ b/program/include/main.inc
@@ -378,20 +378,20 @@ function rcmail_logout_actions()
function get_table_name($table)
{
global $CONFIG;
-
+
// return table name if configured
$config_key = 'db_table_'.$table;
if (strlen($CONFIG[$config_key]))
return $CONFIG[$config_key];
-
+
return $table;
}
/**
* 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
@@ -399,13 +399,13 @@ function get_table_name($table)
function get_sequence_name($sequence)
{
global $CONFIG;
-
+
// return table name if configured
$config_key = 'db_sequence_'.$sequence;
if (strlen($CONFIG[$config_key]))
return $CONFIG[$config_key];
-
+
return $sequence;
}
@@ -1483,12 +1483,14 @@ function create_attrib_string($attrib, $allowed_attribs=array('id', 'class', 'st
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 @@ function console($msg)
* 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)
{