[arch-commits] Commit in web-news/repos (4 files)

Felix Yan felixonmars at archlinux.org
Tue Jul 7 16:53:27 UTC 2020


    Date: Tuesday, July 7, 2020 @ 16:53:27
  Author: felixonmars
Revision: 659464

archrelease: copy trunk to community-staging-any

Added:
  web-news/repos/community-staging-any/
  web-news/repos/community-staging-any/PKGBUILD
    (from rev 659462, web-news/trunk/PKGBUILD)
  web-news/repos/community-staging-any/php7.patch
    (from rev 659462, web-news/trunk/php7.patch)
  web-news/repos/community-staging-any/utf8.patch
    (from rev 659462, web-news/trunk/utf8.patch)

------------+
 PKGBUILD   |   39 +++++++++++++++++++++++++++++++++++++
 php7.patch |   45 ++++++++++++++++++++++++++++++++++++++++++
 utf8.patch |   62 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 146 insertions(+)

Copied: web-news/repos/community-staging-any/PKGBUILD (from rev 659462, web-news/trunk/PKGBUILD)
===================================================================
--- community-staging-any/PKGBUILD	                        (rev 0)
+++ community-staging-any/PKGBUILD	2020-07-07 16:53:27 UTC (rev 659464)
@@ -0,0 +1,39 @@
+# Maintainer: Sergej Pupykin <pupykin.s+arch at gmail.com>
+
+pkgname=web-news
+pkgver=1.6.4
+pkgrel=8
+pkgdesc="A PHP web-based NNTP client"
+arch=('any')
+url="https://sourceforge.net/projects/web-news"
+license=('GPL')
+depends=('php')
+backup=('etc/webapps/web-news/.htaccess'
+	'etc/webapps/web-news/webnews.cfg.php')
+source=(https://downloads.sourceforge.net/sourceforge/web-news/WebNews-$pkgver.tar.gz
+	utf8.patch
+	php7.patch)
+sha256sums=('1bdaa877dfee7e42b3d44784c049758cfffb6e959a3523923bae40cc64259041'
+            'ec880d02c7d935e0f7dc2a5e2a5c5839d2a0830734f37386343d4bb7ff315518'
+            '999d62293de394f1ebdc04890d32506e9a53d692e0cd6e039c8561a25728c88e')
+
+prepare() {
+  cd "$srcdir"
+  patch -p1 <utf8.patch && rm -f utf8.patch
+  patch -p1 <php7.patch && rm -f php7.patch
+  find . -type f -name '*.orig' -exec rm -f {} \;
+}
+
+package() {
+  _instdir="$pkgdir"/usr/share/webapps/web-news
+  mkdir -p ${_instdir} "$pkgdir"/etc/webapps/web-news
+  cd ${_instdir}
+  rm -f "$srcdir"/WebNews-$pkgver.tar.gz
+  cp -ra "$srcdir"/* .
+
+  echo -e "deny from all\nAddDefaultCharset utf-8" >"$pkgdir"/etc/webapps/web-news/.htaccess
+  ln -s /etc/webapps/web-news/.htaccess .htaccess
+
+  mv config/webnews.cfg.php "$pkgdir"/etc/webapps/web-news/
+  ln -s /etc/webapps/web-news/webnews.cfg.php config/webnews.cfg.php
+}

Copied: web-news/repos/community-staging-any/php7.patch (from rev 659462, web-news/trunk/php7.patch)
===================================================================
--- community-staging-any/php7.patch	                        (rev 0)
+++ community-staging-any/php7.patch	2020-07-07 16:53:27 UTC (rev 659464)
@@ -0,0 +1,45 @@
+diff -wbBur src/webnews/MIME_Message.php src.my/webnews/MIME_Message.php
+--- src/webnews/MIME_Message.php	2004-09-20 15:58:04.000000000 +0400
++++ src.my/webnews/MIME_Message.php	2016-02-16 18:02:11.415650635 +0300
+@@ -64,7 +64,7 @@
+ 		function decode_header($headers) {
+ 			$header_want = "/^(From|Subject|Date|Newsgroups|References|Message-ID|Content-Type|Content-Transfer-Encoding|Content-Disposition|Content-ID): (.*$)/i";
+ 			
+-			$headers = split("\r\n", $headers);
++			$headers = explode("\r\n", $headers);
+ 
+ 			// Parse the header
+ 			for ($line_count = 0; $line_count < sizeof($headers);$line_count++) {
+@@ -88,7 +88,7 @@
+ 
+ 		// An article is a raw MIME message
+ 		function decode_article($article) {
+-			list($header, $body) = split("\r\n\r\n", $article, 2);
++			list($header, $body) = explode("\r\n\r\n", $article, 2);
+ 						
+ 			$header = $this->decode_header($header);
+ 
+diff -wbBur src/webnews/util.php src.my/webnews/util.php
+--- src/webnews/util.php	2006-03-28 21:59:23.000000000 +0400
++++ src.my/webnews/util.php	2016-02-16 18:02:11.415650635 +0300
+@@ -46,7 +46,10 @@
+ 			$str = $matches[1].quoted_printable_decode($str).$matches[3];
+ 		}
+ 		while (preg_match("/=\?.*\?b\?.*\?=/i", $str)) {
+-			$str = preg_replace("/(.*)=\?.*\?b\?(.*)\?=(.*)/ie", "'$1'.base64_decode('$2').'$3'", $str);
++			$str = preg_replace_callback("/(.*)=\?.*\?b\?(.*)\?=(.*)/i",
++				function ($matches) {
++					return $matches[1].base64_decode($matches[2]).$matches[3];
++				}, $str);
+ 		}
+ 
+ 		return $str;
+@@ -403,7 +406,7 @@
+ 						$ini[$section_name] = array();
+ 					}
+ 				} else if (strpos($buf, "=") !== FALSE) {
+-					list($key, $value) = split("=", $buf, 2);
++					list($key, $value) = explode("=", $buf, 2);
+ 					$value = preg_replace("/^(['|\"])?(.*?)(?(1)['|\"])$/", "\\2", trim($value));
+ 
+ 					if ((strlen($key) != 0) && (strlen($value) != 0)) {					

Copied: web-news/repos/community-staging-any/utf8.patch (from rev 659462, web-news/trunk/utf8.patch)
===================================================================
--- community-staging-any/utf8.patch	                        (rev 0)
+++ community-staging-any/utf8.patch	2020-07-07 16:53:27 UTC (rev 659464)
@@ -0,0 +1,62 @@
+diff -wbBur web-news/webnews/nntp.php Web-News/webnews/nntp.php
+--- web-news/webnews/nntp.php	2006-03-28 20:31:41.000000000 +0400
++++ Web-News/webnews/nntp.php	2011-07-04 14:04:36.000000000 +0400
+@@ -468,7 +468,7 @@
+ 						$boundary = "--".$boundary;
+ 					} else {
+ 						$boundary = "";
+-						$send_message .= "Content-Type: text/plain\r\n";
++						$send_message .= "Content-Type: text/plain; charset=UTF-8;\r\n";
+ 					}
+ 
+ 					if ($references && (strlen($references) != 0)) {
+diff -wbBur web-news/webnews/rss.php Web-News/webnews/rss.php
+--- web-news/webnews/rss.php	2006-03-27 18:27:29.000000000 +0400
++++ Web-News/webnews/rss.php	2011-07-04 13:42:22.000000000 +0400
+@@ -38,7 +38,7 @@
+ 
+ 	ob_clean();
+ 	header("Content-Type: application/xml");
+-	echo '<?xml version="1.0" encoding="ISO-8859-1" ?>'."\n";
++	echo '<?xml version="1.0" encoding="UTF-8" ?>'."\n";
+ ?>
+ <rss version="2.0">
+ 	<channel>
+diff -wbBur web-news/webnews/util.php Web-News/webnews/util.php
+--- web-news/webnews/util.php	2006-03-28 20:40:21.000000000 +0400
++++ Web-News/webnews/util.php	2011-07-04 14:02:57.000000000 +0400
+@@ -54,24 +54,7 @@
+ 	
+ 	
+ 	function encode_MIME_header($str) {
+-		if (is_non_ASCII($str)) {
+-			$result = "=?ISO-8859-1?Q?";
+-			for ($i = 0;$i < strlen($str);$i++) {
+-				$ascii = ord($str{$i});
+-				if ($ascii == 0x20) {	// Space
+-					$result .= "_";
+-				} else if (($ascii == 0x3D) || ($ascii == 0x3F) || ($ascii == 0x5F) || ($ascii > 0x7F)) {	// =, ?, _, 8 bit
+-					$result .= "=".dechex($ascii);
+-				} else {
+-					$result .= $str{$i};
+-				}
+-			}
+-			$result .= "?=";
+-		} else {
+-			$result = $str;
+-		}
+-		
+-		return $result;
++		return "=?UTF-8?B?".base64_encode($str)."?=";
+ 	}
+ 	
+ 	
+@@ -212,7 +195,7 @@
+ 			$counter = 0;
+ 			$message_body .= "This is a multi-part message in MIME format\r\n";
+ 			$message_body .= $boundary."\r\n";
+-			$message_body .= "Content-Type: text/plain\r\n";
++			$message_body .= "Content-Type: text/plain; charset=UTF-8;\r\n";
+ 			$message_body .= "\r\n";
+ 			$message_body .= $message;
+ 			$message_body .= "\r\n\r\n";



More information about the arch-commits mailing list