rpms/roundcubemail/F-8 roundcubemail-0.2-beta-html2text.patch, NONE, 1.1 roundcubemail.spec, 1.10, 1.11

Jon Ciesla limb at fedoraproject.org
Fri Dec 12 16:30:57 UTC 2008


Author: limb

Update of /cvs/pkgs/rpms/roundcubemail/F-8
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv2563/F-8

Modified Files:
	roundcubemail.spec 
Added Files:
	roundcubemail-0.2-beta-html2text.patch 
Log Message:
BZ 476223.


roundcubemail-0.2-beta-html2text.patch:

--- NEW FILE roundcubemail-0.2-beta-html2text.patch ---
--- program/lib/html2text.php.orig	2008-08-30 07:35:36.000000000 -0500
+++ program/lib/html2text.php	2008-12-12 10:09:19.000000000 -0600
@@ -152,2 +151,0 @@
-        '/<h[123][^>]*>(.*?)<\/h[123]>/ie',      // H1 - H3
-        '/<h[456][^>]*>(.*?)<\/h[456]>/ie',      // H4 - H6
@@ -156,2 +153,0 @@
-        '/<b[^>]*>(.*?)<\/b>/ie',                // <b>
-        '/<strong[^>]*>(.*?)<\/strong>/ie',      // <strong>
@@ -164,2 +159,0 @@
-        '/<a [^>]*href=("|\')([^"\']+)\1[^>]*>(.*?)<\/a>/ie',
-                                                 // <a href="">
@@ -170 +163,0 @@
-        '/<th[^>]*>(.*?)<\/th>/ie',              // <th> and </th>
@@ -204,2 +196,0 @@
-        "strtoupper(\"\n\n\\1\n\n\")",          // H1 - H3
-        "ucwords(\"\n\n\\1\n\")",             // H4 - H6
@@ -208,2 +198,0 @@
-        'strtoupper("\\1")',                    // <b>
-        'strtoupper("\\1")',                    // <strong>
@@ -216,2 +204,0 @@
-    	'$this->_build_link_list("\\2", "\\3")',
-    	                                	// <a href="">
@@ -222 +208,0 @@
-        "strtoupper(\"\t\t\\1\n\")",            // <th> and </th>
@@ -235 +221 @@
-        '£',
+        '£',
@@ -240,0 +227,16 @@
+    /**
+     *  List of preg* regular expression patterns to search for
+     *  and replace using callback function.
+     *
+     *  @var array $callback_search
+     *  @access public
+     */
+    var $callback_search = array(
+        '/<(h)[123456][^>]*>(.*?)<\/h[123456]>/i', // H1 - H3
+        '/<(b)[^>]*>(.*?)<\/b>/i',                 // <b>
+        '/<(strong)[^>]*>(.*?)<\/strong>/i',       // <strong>
+        '/<(a) [^>]*href=("|\')([^"\']+)\2[^>]*>(.*?)<\/a>/i',
+                                                   // <a href="">
+        '/<(th)[^>]*>(.*?)<\/th>/i',               // <th> and </th>
+    );
+
@@ -468 +470,4 @@
-	
+
+	// Replace known html entities
+	$text = html_entity_decode($text, ENT_COMPAT, 'UTF-8');
+
@@ -470,0 +476 @@
+        $text = preg_replace_callback($this->callback_search, array('html2text', '_preg_callback'), $text);
@@ -546 +552 @@
-	    $text = preg_replace('/<pre[^>]*>.*<\/pre>/ismU', '<div><br>' . $result . '<br></div>', $text);
+	    $text = preg_replace('/<pre[^>]*>.*<\/pre>/ismU', '<div><br>' . $result . '<br></div>', $text, 1);
@@ -548,0 +555,38 @@
+
+    /**
+     *  Callback function for preg_replace_callback use.
+     *
+     *  @param  array PREG matches
+     *  @return string
+     *  @access private
+     */
+    function _preg_callback($matches)
+    {
+	switch($matches[1])
+	{
+	    case 'b':
+	    case 'strong':
+		return $this->_strtoupper($matches[2]);
+	    case 'hr':
+		return $this->_strtoupper("\t\t". $matches[2] ."\n");
+	    case 'h':
+		return $this->_strtoupper("\n\n". $matches[2] ."\n\n");
+	    case 'a':
+    	        return $this->_build_link_list($matches[3], $matches[4]);
+	}
+    }
+    
+    /**
+     *  Strtoupper multibyte wrapper function
+     *
+     *  @param  string
+     *  @return string
+     *  @access private
+     */
+    function _strtoupper($str)
+    {
+	if (function_exists('mb_strtoupper'))
+    	    return mb_strtoupper($str);
+    	else
+	    return strtoupper($str);
+    }


Index: roundcubemail.spec
===================================================================
RCS file: /cvs/pkgs/rpms/roundcubemail/F-8/roundcubemail.spec,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- roundcubemail.spec	16 Jun 2008 15:06:27 -0000	1.10
+++ roundcubemail.spec	12 Dec 2008 16:30:27 -0000	1.11
@@ -1,17 +1,19 @@
 %define roundcubedir %{_datadir}/roundcubemail
 Name: roundcubemail
 Version:  0.2
-Release:  1.alpha%{?dist}
+Release:  4.beta%{?dist}
 Summary: Round Cube Webmail is a browser-based multilingual IMAP client
 
 Group: Applications/System         
 License: GPLv2
 URL: http://www.roundcube.net
-Source0: roundcubemail-%{version}-alpha-dep.tar.gz
+Source0: roundcubemail-%{version}-beta-dep.tar.gz
 Source1: roundcubemail.conf
 Source2: roundcubemail.logrotate
 Source4: roundcubemail-README.fedora
-Patch0: roundcubemail-0.2-alpha-confpath.patch
+Patch0: roundcubemail-0.2-beta-confpath.patch
+# From upstream, not in a release yet, BZ 476223.
+Patch1: roundcubemail-0.2-beta-html2text.patch
 
 BuildArch: noarch
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root%(%{__id_u} -n)
@@ -39,17 +41,15 @@
 interface is fully skinnable using XHTML and CSS 2.
 
 %prep
-%setup -q -n roundcubemail-0.2-alpha-dependent
+%setup -q -n roundcubemail-0.2-beta-dep
 
 %patch0 -p0
+%patch1 -p0
 
 # fix permissions and remove any .htaccess files
 find . -type f -print | xargs chmod a-x
 find . -name \.htaccess -print | xargs rm -f
 
-# remove curious mac os x files
-find . -name '._*' -print | xargs rm -rf
-
 # fixup paths to use the right paths
 sed -i 's|temp/|${_tmppath}|' config/main.inc.php.dist
 sed -i 's|config/|%{_sysconfdir}/roundcubemail/|' config/main.inc.php.dist
@@ -132,6 +132,15 @@
 %config(noreplace) %{_sysconfdir}/logrotate.d/roundcubemail
 
 %changelog
+* Fri Dec 12 2008 Jon Ciesla <limb at jcomserv.net> = 0.2-4.beta
+- Security fix, BZ 476223.
+
+* Thu Oct 09 2008 Jon Ciesla <limb at jcomserv.net> = 0.2-3.beta
+- New upstream.
+
+* Mon Jun 16 2008 Jon Ciesla <limb at jcomserv.net> = 0.2-2.alpha
+- osx files removed upstream.
+
 * Mon Jun 16 2008 Jon Ciesla <limb at jcomserv.net> = 0.2-1.alpha
 - Fixed php-xml, php-mbstring Requires.  BZ 451652.
 - Removing osx files, will be pulled from next upstream release.




More information about the fedora-extras-commits mailing list