Index: coder.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/coder/coder.module,v
retrieving revision 1.55.2.19.4.6
diff -u -r1.55.2.19.4.6 coder.module
--- coder.module 21 Nov 2007 13:51:33 -0000 1.55.2.19.4.6
+++ coder.module 21 Nov 2007 17:02:45 -0000
@@ -1,5 +1,5 @@
 <?php
-// $Id: coder.module,v 1.55.2.19.4.6 2007/11/21 13:51:33 snpower Exp $
+// $Id: coder.module,v 1.55.2.19.4.5 2007/09/16 06:13:28 douggreen Exp $

 /** @file
  * Developer Module that assists with code review and version upgrade that
@@ -707,6 +707,7 @@
     $in_comment = 0;
     $beginning_of_line = 0;
     $in_php = 0;
+    $in_allphp = 0;
     $in_quote_html = 0;
     $in_backslash = 0;
     $in_quote = 0;
@@ -715,12 +716,14 @@
     $heredoc = '';
     $all_lines = array();
     $php_lines = array();
+    $allphp_lines = array();
     $html_lines = array();
     $quote_lines = array();
     $doublequote_lines = array();
     $comment_lines = array();
     $this_all_lines = '';
     $this_php_lines = '';
+    $this_allphp_lines = '';
     $this_html_lines = '';
     $this_quote_lines = '';
     $this_doublequote_lines = '';
@@ -749,6 +752,9 @@
           if (trim($this_php_lines) != '') {
             $php_lines[$lineno] = $this_php_lines;
           }
+          if (trim($this_allphp_lines) != '') {
+            $allphp_lines[$lineno] = $this_allphp_lines;
+          }
           if (trim($this_html_lines) != '') {
             $html_lines[$lineno] = $this_html_lines;
           }
@@ -767,6 +773,7 @@
         $lineno ++;
         $this_all_lines = '';
         $this_php_lines = '';
+        $this_allphp_lines = '';
         $this_html_lines = '';
         $this_quote_lines = '';
         $this_doublequote_lines = '';
@@ -779,7 +786,7 @@
       }
       $this_all_lines .= $char;

-      if ($in_php) {
+      if ($in_php || $in_allphp) {
         // when in a quoted string, look for the trailing quote
         // strip characters in the string, replacing with '' or ""
         if ($in_quote) {
@@ -807,6 +814,7 @@
           if ($char == $in_quote_html) {
             $in_quote_html = 0;
           }
+          $this_allphp_lines .= $char;
           unset($char); // NOTE: trailing char output with starting one
         }

@@ -832,6 +840,7 @@
         elseif ($char == '?' && $content[$pos + 1] == '>') {
           unset($char);
           $in_php = 0;
+          $in_allphp = 0;
           $this_all_lines .= '>';
           $pos ++;
         }
@@ -893,6 +902,7 @@

                 // replace heredoc's with an empty string
                 $this_php_lines .= '\'\'';
+                $this_allphp_lines .= '\'\'';
                 unset($char);
               }
               break;
@@ -900,6 +910,7 @@
         }
         if (isset($char)) {
           $this_php_lines .= $char;
+          $this_allphp_lines .= $char;
         }
       }
       else {
@@ -908,11 +919,13 @@
             if ($content[$pos + 1] == '?') {
               if ($content[$pos + 2] == ' ') {
                 $in_php = 1;
+                $in_allphp = 1;
                 $this_all_lines .= '? ';
                 $pos += 2;
               }
               elseif (substr($content, $pos + 2, 3) == 'php') {
                 $in_php = 1;
+                $in_allphp = 1;
                 $this_all_lines .= '?php';
                 $pos += 4;
               }
@@ -929,6 +942,7 @@
     // add the files lines to the arguments
     $coder_args['#all_lines'] = $all_lines;
     $coder_args['#php_lines'] = $php_lines;
+    $coder_args['#allphp_lines'] = $allphp_lines;
     $coder_args['#html_lines'] = $html_lines;
     $coder_args['#quote_lines'] = $quote_lines;
     $coder_args['#doublequote_lines'] = $doublequote_lines;
@@ -986,7 +1000,7 @@
         if (isset($rule['#original'])) { // deprecated
           $lines = $coder_args['#all_lines'];
         }
-        elseif (isset($rule['#source'])) { // all, html, comment, or php
+        elseif (isset($rule['#source'])) { // all, html, comment, allphp or php
           $source = '#'. $rule['#source'] .'_lines';
           $lines = $coder_args[$source];
         }
