svn: web/php-bugs/trunk/ rpc.php
| From: | Gwynne Raskind | Date: | Mon, 20 Jul 2009 15:57:11 +0000 |
| Subject: | svn: web/php-bugs/trunk/ rpc.php | ||
| Groups: | php.webmaster | ||
| Request: | Send a blank email to php-webmaster+get-5454@lists.php.net to get a copy of this message | ||
gwynne Mon, 20 Jul 2009 15:57:11 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=284450
Log:
get MySQL to return UTF-8 data for json_encode(), and add a hook to only fetch bug data
Changed paths:
U web/php-bugs/trunk/rpc.php
Modified: web/php-bugs/trunk/rpc.php
===================================================================
--- web/php-bugs/trunk/rpc.php 2009-07-20 15:27:33 UTC (rev 284449)
+++ web/php-bugs/trunk/rpc.php 2009-07-20 15:57:11 UTC (rev 284450)
@@ -22,6 +22,7 @@
@mysql_connect("localhost","nobody","") or die("Unable to
connect to SQL server.");
@mysql_select_db("phpbugdb");
+@mysql_query("SET NAMES utf8");
# fetch info about the bug into $bug
$query = "SELECT id,bug_type,email,sdesc,ldesc,php_version,php_os,status,ts1,ts2,assign,"
@@ -55,6 +56,9 @@
echo json_encode(array('result'=>array('error'=>mysql_error())));
exit;
}
+} else if (!empty($_POST['getbug'])) {
+ echo json_encode(array('result'=>array('status'=>$bug)));
+ exit;
}
echo json_encode(array('result'=>array('error'=>'Nothing to
do')));