From 8a30c7d63d9ef1e4dd91c7b16d1c1571f71e9b04 Mon Sep 17 00:00:00 2001 From: =?utf8?q?St=C3=A9phane=20Jacob?= Date: Tue, 22 Feb 2011 10:11:37 +0100 Subject: [PATCH] Fixes deprecated features in PHP 5.3.x. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Stéphane Jacob --- banana/banana.inc.php.in | 2 +- banana/feed.inc.php | 2 +- banana/mbox.inc.php | 4 ++-- banana/message.func.inc.php | 12 ++++++------ banana/nntp.inc.php | 4 ++-- banana/nntpcore.inc.php | 2 +- banana/page.inc.php | 10 +++++----- banana/protocoleinterface.inc.php | 4 ++-- banana/spool.inc.php | 10 +++++----- banana/tree.inc.php | 4 ++-- 10 files changed, 27 insertions(+), 27 deletions(-) diff --git a/banana/banana.inc.php.in b/banana/banana.inc.php.in index 1efc68b..73f5801 100644 --- a/banana/banana.inc.php.in +++ b/banana/banana.inc.php.in @@ -509,7 +509,7 @@ class Banana $hdr_values[$header] = utf8_encode($hdr_values[$header]); } } - $values = split('[,; ]', $hdr_values[$hdrs['dest']]); + $values = preg_split('[,; ]', $hdr_values[$hdrs['dest']]); $hdr_values[$hdrs['dest']] = preg_replace('/,+/', ',', implode(',', $values)); if (!is_null($artid)) { $old =& $this->loadMessage($group, $artid); diff --git a/banana/feed.inc.php b/banana/feed.inc.php index 9f177e7..e9125de 100644 --- a/banana/feed.inc.php +++ b/banana/feed.inc.php @@ -138,7 +138,7 @@ class BananaFeed /** Merge to feeds into a new one */ - static public function &merge(&$feed1, &$feed2, $name, $description = null) + static public function &merge($feed1, $feed2, $name, $description = null) { if (!$feed1) { $feed = null; diff --git a/banana/mbox.inc.php b/banana/mbox.inc.php index 1f158c9..f48c877 100644 --- a/banana/mbox.inc.php +++ b/banana/mbox.inc.php @@ -226,7 +226,7 @@ class BananaMBox implements BananaProtocoleInterface /** Send a message * @return true if it was successfull */ - public function send(BananaMessage &$message) + public function send(BananaMessage $message) { $headers = $message->getHeaders(); $to = $headers['To']; @@ -246,7 +246,7 @@ class BananaMBox implements BananaProtocoleInterface /** Cancel a message * @return true if it was successfull */ - public function cancel(BananaMessage &$message) + public function cancel(BananaMessage $message) { return false; } diff --git a/banana/message.func.inc.php b/banana/message.func.inc.php index e32d973..ea9e11f 100644 --- a/banana/message.func.inc.php +++ b/banana/message.func.inc.php @@ -234,7 +234,7 @@ function banana_wrap($text, $base_level = 0, $strict = true) return $text; } -function banana_formatPlainText(BananaMimePart &$part, $base_level = 0) +function banana_formatPlainText(BananaMimePart $part, $base_level = 0) { $text = $part->getText(); if ($part->isFlowed()) { @@ -244,7 +244,7 @@ function banana_formatPlainText(BananaMimePart &$part, $base_level = 0) return banana_plainTextToHtml($text, $part->isFlowed()); } -function banana_quotePlainText(BananaMimePart &$part) +function banana_quotePlainText(BananaMimePart $part) { $text = $part->getText(); if ($part->isFlowed()) { @@ -488,7 +488,7 @@ function banana_htmlToPlainText($res) return banana_html_entity_decode($res); } -function banana_formatHtml(BananaMimePart &$part) +function banana_formatHtml(BananaMimePart $part) { $text = $part->getText(); $text = banana_catchHtmlSignature($text); @@ -499,7 +499,7 @@ function banana_formatHtml(BananaMimePart &$part) return banana_cleanHtml($text, true); } -function banana_quoteHtml(BananaMimePart &$part) +function banana_quoteHtml(BananaMimePart $part) { $text = $part->getText(); $text = banana_htmlToPlainText($text); @@ -542,7 +542,7 @@ function banana_richtextToHtml($source) return banana_cleanHtml($source); } -function banana_formatRichText(BananaMimePart &$part) +function banana_formatRichText(BananaMimePart $part) { $text = $part->getText(); $text = banana_richtextToHtml($text); @@ -550,7 +550,7 @@ function banana_formatRichText(BananaMimePart &$part) return banana_cleanHtml($text); } -function banana_quoteRichtText(BananaMimePart &$part) +function banana_quoteRichtText(BananaMimePart $part) { $text = $part->getText(); $text = banana_richtextToHtml($text); diff --git a/banana/nntp.inc.php b/banana/nntp.inc.php index a9b7be0..f352292 100644 --- a/banana/nntp.inc.php +++ b/banana/nntp.inc.php @@ -209,7 +209,7 @@ class BananaNNTP extends BananaNNTPCore implements BananaProtocoleInterface /** Send the message */ - public function send(BananaMessage &$message) + public function send(BananaMessage $message) { $sources = $message->get(true); return $this->post($sources); @@ -217,7 +217,7 @@ class BananaNNTP extends BananaNNTPCore implements BananaProtocoleInterface /** Cancel the message */ - public function cancel(BananaMessage &$message) + public function cancel(BananaMessage $message) { $headers = Array('From' => Banana::$profile['From'], 'Newsgroups' => Banana::$group, diff --git a/banana/nntpcore.inc.php b/banana/nntpcore.inc.php index 3029c08..070135b 100644 --- a/banana/nntpcore.inc.php +++ b/banana/nntpcore.inc.php @@ -469,7 +469,7 @@ class BananaNNTPCore $array =& $this->fetchResult(); $groups = array(); foreach ($array as &$result) { - @list($group, $desc) = split("[ \t]", $result, 2); + @list($group, $desc) = preg_split("[ \t]", $result, 2); $groups[$group] = $desc; } return $groups; diff --git a/banana/page.inc.php b/banana/page.inc.php index 40fd970..8b2602c 100644 --- a/banana/page.inc.php +++ b/banana/page.inc.php @@ -236,7 +236,7 @@ class BananaPage extends Smarty * * smarty funciton : {url param1=... param2=...} */ - public function makeUrl(array $params, &$smarty = null) + public function makeUrl(array $params, $smarty = null) { if (function_exists('hook_makeLink') && $res = hook_makeLink($params)) { @@ -274,7 +274,7 @@ class BananaPage extends Smarty * * Smarty function : {link param1=... param2=...} */ - public function makeLink(array $params, &$smarty = null) + public function makeLink(array $params, $smarty = null) { $catch = array('text', 'popup', 'class', 'accesskey', 'style'); foreach ($catch as $key) { @@ -318,7 +318,7 @@ class BananaPage extends Smarty * * Smarty function: {img img=... alt=... [height=...] [width=...]} */ - public function makeImg(array $params, &$smarty = null) + public function makeImg(array $params, $smarty = null) { $catch = array('img', 'alt', 'height', 'width'); foreach ($catch as $key) { @@ -377,7 +377,7 @@ class BananaPage extends Smarty * * Smarty function : {imglink img=... alt=... [param1=...]} */ - public function makeImgLink(array $params, &$smarty = null) + public function makeImgLink(array $params, $smarty = null) { if (!isset($params['popup'])) { $params['popup'] = @$params['alt']; @@ -406,7 +406,7 @@ class BananaPage extends Smarty // {{{ function banana_trimwhitespace -function banana_trimwhitespace($source, &$smarty) +function banana_trimwhitespace($source, $smarty) { $tags = array('script', 'pre', 'textarea'); diff --git a/banana/protocoleinterface.inc.php b/banana/protocoleinterface.inc.php index f949a01..e059ec5 100644 --- a/banana/protocoleinterface.inc.php +++ b/banana/protocoleinterface.inc.php @@ -90,12 +90,12 @@ interface BananaProtocoleInterface /** Send a message * @return true if it was successfull */ - public function send(BananaMessage &$message); + public function send(BananaMessage $message); /** Cancel a message * @return true if it was successfull */ - public function cancel(BananaMessage &$message); + public function cancel(BananaMessage $message); /** Return the protocole name */ diff --git a/banana/spool.inc.php b/banana/spool.inc.php index 86719f5..6899532 100644 --- a/banana/spool.inc.php +++ b/banana/spool.inc.php @@ -164,7 +164,7 @@ class BananaSpool return $spool; } - private function compare(&$a, &$b) + private function compare($a, $b) { return ($b->date - $a->date); } @@ -468,7 +468,7 @@ class BananaSpool } } - public function formatDate(BananaSpoolHead &$head) + public function formatDate(BananaSpoolHead $head) { $stamp = $head->date; $today = intval(time() / (24*3600)); @@ -488,7 +488,7 @@ class BananaSpool return strftime($format, $stamp); } - public function formatSubject(BananaSpoolHead &$head) + public function formatSubject(BananaSpoolHead $head) { $subject = $popup = $head->subject; $popup = $subject; @@ -508,7 +508,7 @@ class BananaSpool return $subject . $link; } - public function formatFrom(BananaSpoolHead &$head) + public function formatFrom(BananaSpoolHead $head) { return BananaMessage::formatFrom($head->from); } @@ -652,7 +652,7 @@ class BananaSpool /** Look for an unread message in the thread rooted by the message * @param id INTEGER message number */ - private function _nextUnread(BananaSpoolHead &$cur) + private function _nextUnread(BananaSpoolHead $cur) { if (!$cur->isread) { return $cur->id; diff --git a/banana/tree.inc.php b/banana/tree.inc.php index 6a3d1cc..98c66f4 100644 --- a/banana/tree.inc.php +++ b/banana/tree.inc.php @@ -40,7 +40,7 @@ class BananaTree /** Construct a new tree from a given root */ - public function __construct(BananaSpoolHead &$root) + public function __construct(BananaSpoolHead $root) { if (empty($root->children)) { $this->data = null; @@ -52,7 +52,7 @@ class BananaTree $this->saveToFile($root->id); } - private function &builder(BananaSpoolHead &$head) + private function &builder(BananaSpoolHead $head) { $array = array(array($head->id)); $this->urls[$head->id] = banana_entities(Banana::$page->makeURL(array('group' => Banana::$group, -- 2.1.4