[rkward-cvs] SF.net SVN: rkward:[2504] trunk/rkward/rkward/scriptbackends/common.php

tfry at users.sourceforge.net tfry at users.sourceforge.net
Wed May 27 11:22:15 UTC 2009


Revision: 2504
          http://rkward.svn.sourceforge.net/rkward/?rev=2504&view=rev
Author:   tfry
Date:     2009-05-27 11:22:14 +0000 (Wed, 27 May 2009)

Log Message:
-----------
Slight simplification of quoting

Modified Paths:
--------------
    trunk/rkward/rkward/scriptbackends/common.php

Modified: trunk/rkward/rkward/scriptbackends/common.php
===================================================================
--- trunk/rkward/rkward/scriptbackends/common.php	2009-05-26 19:42:29 UTC (rev 2503)
+++ trunk/rkward/rkward/scriptbackends/common.php	2009-05-27 11:22:14 UTC (rev 2504)
@@ -21,22 +21,22 @@
 }
 
 function makeHeaderCode ($title, $parameters=array ()) {
-	echo ("rk.header(\"" . escapeQuotes ($title) . "\"");
+	echo ("rk.header(" . quote ($title));
 	if (!empty ($parameters)) {
 		echo (", parameters=list(");
 		$first = true;
 		foreach ($parameters as $key => $value) {
 			if ($first) $first = false;
 			else echo (",\n\t");
-			echo ("\"" . escapeQuotes ($key) . "\", \"" . escapeQuotes ($value) . "\"");
+			echo (quote($key) . ', ' . quote ($value));
 		}
 		echo (")");
 	}
 	echo (")\n");
 }
 
-function escapeQuotes ($input) {
-	return (str_replace ("\"", "\\\"", $input));
+function quote ($input) {
+	return ('"' . str_replace ("\"", "\\\"", $input) . '"');
 }
 
 function getInput ($prompt) {


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the rkward-tracker mailing list