Control: tag -1 + upstream fixed-upstream patch
Control: forwarded -1 http://email.uoa.gr/avelsieve/ticket/269

On Fri, 22 Feb 2013 08:41:43 -0500, Joseph Spiros wrote:

> PHP Fatal error:  Call to undefined function session_unregister() in 
> /usr/share/squirrelmail/plugins/avelsieve/include/html_rulestable.inc.php on 
> line 164
> 
> Brief googling indicates that session_unregister is a PHP function that is 
> removed in PHP 5.4+. Although not listed as an avelsieve dependency, PHP is 
> required to run it, and the current php5 package installed on my system, and 
> available in both testing and unstable, is 5.4.4.

This is already fixed upstream:
http://email.uoa.gr/avelsieve/changeset/1091

I'm attaching a debdiff that incorporates this changeset as a quilt
patch. (With one more "session_unregister" rewritten, also fixed
upstream in r1113.)


Cheers,
gregor

-- 
 .''`.  Homepage: http://info.comodo.priv.at/ - OpenPGP key 0xBB3A68018649AA06
 : :' : Debian GNU/Linux user, admin, and developer  -  http://www.debian.org/
 `. `'  Member of VIBE!AT & SPI, fellow of the Free Software Foundation Europe
   `-   NP: Aziza MustafĂ  Zadeh: Father
diff -Nru avelsieve-1.9.9/debian/changelog avelsieve-1.9.9/debian/changelog
--- avelsieve-1.9.9/debian/changelog    2012-09-09 17:57:18.000000000 +0200
+++ avelsieve-1.9.9/debian/changelog    2013-02-24 15:55:47.000000000 +0100
@@ -1,3 +1,13 @@
+avelsieve (1.9.9-2.4) UNRELEASED; urgency=low
+
+  * Non-maintainer upload.
+  * Fix "Uses deprecated/removed session_unregister PHP function":
+    new patch avelsieve-changeset-1091.patch, taken from upstream svn:
+    replace deprecated/removed PHP functions.
+    (Closes: #701182)
+
+ -- gregor herrmann <gre...@debian.org>  Sun, 24 Feb 2013 15:54:55 +0100
+
 avelsieve (1.9.9-2.3) unstable; urgency=low
 
   * Non-maintainer upload.
diff -Nru avelsieve-1.9.9/debian/patches/avelsieve-changeset-1091.patch 
avelsieve-1.9.9/debian/patches/avelsieve-changeset-1091.patch
--- avelsieve-1.9.9/debian/patches/avelsieve-changeset-1091.patch       
1970-01-01 01:00:00.000000000 +0100
+++ avelsieve-1.9.9/debian/patches/avelsieve-changeset-1091.patch       
2013-02-24 16:09:19.000000000 +0100
@@ -0,0 +1,151 @@
+Description: update deprecated/removed PHP functions
+Origin: upstream, http://email.uoa.gr/avelsieve/changeset/1091 ,
+ http://email.uoa.gr/avelsieve/changeset/1113
+Bug: http://email.uoa.gr/avelsieve/ticket/269
+Bug-Debian: http://bugs.debian.org/701182
+Author: avel
+Reviewed-by: gregor herrmann <gre...@debian.org>
+Last-Update: 2013-02-24
+Applied-Upstream: yes, cf. Origin
+
+--- a/include/managesieve.lib.php
++++ b/include/managesieve.lib.php
+@@ -139,13 +139,13 @@
+     unset($this->error_raw);
+ 
+     $this->line=fgets($this->fp,1024);
+-    $this->token = split(" ", $this->line, 2);
++    $this->token = preg_split('/ /', $this->line, 2);
+ 
+     if($this->token[0] == "NO"){
+         /* we need to try and extract the error code from here.  There are 
two possibilites: one, that it will take the form of:
+            NO ("yyyyy") "zzzzzzz" or, two, NO {yyyyy} "zzzzzzzzzzz" */
+         $this->x = 0;
+-        list($this->ltoken, $this->mtoken, $this->rtoken) = split(" ", 
$this->line." ", 3);
++        list($this->ltoken, $this->mtoken, $this->rtoken) = preg_split('/ /', 
$this->line." ", 3);
+         if($this->mtoken[0] == "{"){
+             while($this->mtoken[$this->x] != "}" or $this->err_len < 1){
+                 $this->err_len = substr($this->mtoken, 1, $this->x);
+@@ -233,7 +233,7 @@
+            atleast true for timsieved as it sits in 2.1.16, if someone has a 
+            BYE (REFERRAL ...) example for later timsieved please forward it 
to 
+            me and I'll code it in proper-like! - mlof...@wgops.com */
+-        $this->reftok = split(" ", $this->token[1], 3);
++        $this->reftok = preg_split('/ /', $this->token[1], 3);
+         $this->refsv = substr($this->reftok[1], 0, -2);
+         $this->refsv = substr($this->refsv, 1);
+ 
+@@ -438,7 +438,7 @@
+     //response.  They repsond as follows: "Cyrus timsieved v1.0.0" 
"SASL={PLAIN,........}"
+     //So, if we see IMPLEMENTATION in the first line, then we are done.
+ 
+-    if(ereg("IMPLEMENTATION",$this->line))
++    if(preg_match('/IMPLEMENTATION/',$this->line))
+     {
+       //we're on the Cyrus V2 or Cyrus V3 sieve server
+       while(sieve::status($this->line) == F_DATA){
+@@ -454,7 +454,7 @@
+               } else {
+                   $this->cap_type="auth";            
+               }
+-              $this->modules = split(" ", $this->item[1]);
++              $this->modules = preg_split('/ /', $this->item[1]);
+               if(is_array($this->modules)){
+                   foreach($this->modules as $m)
+                       
$this->capabilities[$this->cap_type][strtolower($m)]=true;
+@@ -488,7 +488,7 @@
+         $this->modules = substr($this->item[1], strpos($this->item[1], 
"{"),strlen($this->item[1])-1);
+ 
+         //then split again at the ", " stuff.
+-        $this->modules = split($this->modules, ", ");
++        $this->modules = preg_split('/, /', $this->modules);
+  
+         //fill up our $this->modules property
+         if(is_array($this->modules)){
+@@ -884,7 +884,7 @@
+                   $cap_type="auth";            
+               }
+ 
+-              $this->modules = split(' ', $this->item[1]);
++              $this->modules = preg_split('/ /', $this->item[1]);
+               if(is_array($this->modules)){
+                   foreach($this->modules as $m) {
+                       $this->capabilities[$cap_type][strtolower($m)]=true;
+--- a/include/html_main.inc.php
++++ b/include/html_main.inc.php
+@@ -227,7 +227,7 @@
+      */
+     function clear_avelsieve_messages() {
+         if(isset($_SESSION['comm'])) {
+-            session_unregister('comm');
++            unset($_SESSION['comm']);
+         }
+     }
+     
+--- a/include/html_rulestable.inc.php
++++ b/include/html_rulestable.inc.php
+@@ -161,7 +161,7 @@
+      */
+     function rules_confirmation_text() {
+         $out = $this->retrieve_avelsieve_messages();
+-        session_unregister('comm');
++        unset($_SESSION['comm']);
+         return $out;
+     }
+     
+--- a/setup.php
++++ b/setup.php
+@@ -183,7 +183,7 @@
+     if($box == 'Junk' || $box == 'INBOX.Junk') {
+         return true;
+     }
+-    $parts = split(str_replace('.', '\.',$delimiter), $box);
++    $parts = preg_split('/'.str_replace('.', '\.',$delimiter).'/', $box);
+     if(sizeof($parts) > 1 && ($parts[0] == 'Junk' || $parts[1] == 'Junk')) {
+         return true;
+     }
+--- a/addrule.php
++++ b/addrule.php
+@@ -41,9 +41,9 @@
+ 
+ if(isset($_POST['cancel'])) {
+       unset($_SESSION['newrule']);
+-      session_unregister('newrule');
+       unset($part);
+-      session_unregister('part');
++      if (isset($_SESSION['part']))
++              unset($_SESSION['part']);
+       header("Location: ./table.php");
+       exit;
+ }
+@@ -250,8 +250,8 @@
+       $_SESSION['comm']['new'] = true;
+ 
+       /* Remove addrule.php stuff */
+-      session_unregister('newrule');
+-      session_unregister('part');
++      unset($_SESSION['newrule']);
++      unset($_SESSION['part']);
+ 
+       /* go to table.php */
+       session_write_close();
+--- a/table.php
++++ b/table.php
+@@ -120,7 +120,7 @@
+             $s->delete('phpscript');
+         } */
+     }
+-    session_unregister('rules');
++    unset($_SESSION['rules']);
+     
+     header("Location: $location/../../src/options.php\n\n");
+     // header("Location: 
$location/../../src/options.php?optpage=avelsieve\n\n");
+@@ -364,7 +364,7 @@
+ if (isset($_SESSION['returnnewrule'])) {
+     /* There is a new rule to be added */
+     $newrule = $_SESSION['returnnewrule'];
+-    session_unregister('returnnewrule');
++    unset($_SESSION['returnnewrule']);
+     $rules[] = $newrule;
+     $haschanged = true;
+ }
diff -Nru avelsieve-1.9.9/debian/patches/series 
avelsieve-1.9.9/debian/patches/series
--- avelsieve-1.9.9/debian/patches/series       2012-09-09 17:32:02.000000000 
+0200
+++ avelsieve-1.9.9/debian/patches/series       2013-02-24 15:52:32.000000000 
+0100
@@ -6,3 +6,4 @@
 sieve-default-port
 fixes-call-time-pass-by-reference
 avelsieve-changeset-1144.patch
+avelsieve-changeset-1091.patch

Attachment: signature.asc
Description: Digital signature

Reply via email to