mail[Wesnoth-commits] r28769 - in /branches/resources/tests.wesnoth.org: include/ smarty_workdir/plugins/


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by paniemin on August 19, 2008 - 14:41:
Author: suokko
Date: Tue Aug 19 14:41:35 2008
New Revision: 28769

URL: http://svn.gna.org/viewcvs/wesnoth?rev=28769&view=rev
Log:
Moved autohide text format conversion to smarty plugin code where it should 
have been from start already.

Modified:
    branches/resources/tests.wesnoth.org/include/Build.php
    branches/resources/tests.wesnoth.org/include/FilenameConverter.php
    branches/resources/tests.wesnoth.org/include/TestError.php
    
branches/resources/tests.wesnoth.org/smarty_workdir/plugins/modifier.autohide.php

Modified: branches/resources/tests.wesnoth.org/include/Build.php
URL: 
http://svn.gna.org/viewcvs/wesnoth/branches/resources/tests.wesnoth.org/include/Build.php?rev=28769&r1=28768&r2=28769&view=diff
==============================================================================
--- branches/resources/tests.wesnoth.org/include/Build.php (original)
+++ branches/resources/tests.wesnoth.org/include/Build.php Tue Aug 19 
14:41:35 2008
@@ -208,7 +208,6 @@
                        if (strpos($this->error_msg,'error') !== false 
                                || strpos($this->error_msg,'ld returned'))
                                        $this->status = self::S_ERROR;
-                       $this->error_msg = 
str_replace("'","\\'",$this->error_msg);
                }
 
                $this->time = time();
@@ -319,7 +318,6 @@
                } else {
                        $build_result = "Build failed:\n" . $this->error_msg;
                }
-               $build_result = str_replace("\n"," \\n",$build_result);
 
        
                return array('result'                   => $build_result,

Modified: branches/resources/tests.wesnoth.org/include/FilenameConverter.php
URL: 
http://svn.gna.org/viewcvs/wesnoth/branches/resources/tests.wesnoth.org/include/FilenameConverter.php?rev=28769&r1=28768&r2=28769&view=diff
==============================================================================
--- branches/resources/tests.wesnoth.org/include/FilenameConverter.php 
(original)
+++ branches/resources/tests.wesnoth.org/include/FilenameConverter.php Tue 
Aug 19 14:41:35 2008
@@ -16,7 +16,7 @@
 class FilenameConverter {
        public static function stripBuildDirs($text)
        {
-               return 
preg_replace('/^(build\/[^\/]*\/)?(.*[^\/]+:[0-9]+:.*)$/m','$2',$text);
+               return 
preg_replace('/^(build\/[^\/]*\/)?(.*[^\/]+:[0-9]+:.*|.*[^\/]+)$/m','$2',$text);
        }
 }
 ?>

Modified: branches/resources/tests.wesnoth.org/include/TestError.php
URL: 
http://svn.gna.org/viewcvs/wesnoth/branches/resources/tests.wesnoth.org/include/TestError.php?rev=28769&r1=28768&r2=28769&view=diff
==============================================================================
--- branches/resources/tests.wesnoth.org/include/TestError.php (original)
+++ branches/resources/tests.wesnoth.org/include/TestError.php Tue Aug 19 
14:41:35 2008
@@ -38,7 +38,7 @@
                        $this->error_type = $name;
                        $this->file = 
FilenameConverter::stripBuildDirs((string)$data->attributes()->file);
                        $this->line = (string)$data->attributes()->line;
-                       $this->error_msg = 
str_replace("'","\\'",str_replace("\n","\\n",(string)$data[0]));
+                       $this->error_msg = (string)$data[0];
                        $result = $this->db->Execute('SELECT t.id as id, 
before_id, last_id FROM test_errors t, builds b
                                        WHERE t.error_type=? 
                                        AND t.file=?

Modified: 
branches/resources/tests.wesnoth.org/smarty_workdir/plugins/modifier.autohide.php
URL: 
http://svn.gna.org/viewcvs/wesnoth/branches/resources/tests.wesnoth.org/smarty_workdir/plugins/modifier.autohide.php?rev=28769&r1=28768&r2=28769&view=diff
==============================================================================
--- 
branches/resources/tests.wesnoth.org/smarty_workdir/plugins/modifier.autohide.php
 (original)
+++ 
branches/resources/tests.wesnoth.org/smarty_workdir/plugins/modifier.autohide.php
 Tue Aug 19 14:41:35 2008
@@ -19,13 +19,14 @@
        {
                $split_from_space = $split_from_space?"true":"false";
                $take_end = $take_end?"true":"false";
+               $text = str_replace("'","\\'",str_replace("\n",'\n',$text));
                return "<script type='text/javascript'>
                        /*<![CDATA[*/
                        autohide_store.push(new Autohide('$text', 
$min_length_to_hide, $split_from_space, $take_end));
                        /*]]>*/
                        </script>";
        } else {
-               return str_replace("\\'","'",str_replace('\n',"\n",$text));
+               return $text;
        }
 }
 




Related Messages


Powered by MHonArc, Updated Tue Aug 19 18:00:32 2008