From cd48b89f3166e7fa732b5cb06d33fba018af9127 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Wed, 15 Dec 2010 14:57:00 -0800 Subject: Consolidate all the random code into a random helper that offers: random::hash() random::string() random::percent() random::int() So that we don't have lots of different ways to get random values all over the code. Follow-on to #1527. --- modules/rest/helpers/rest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'modules/rest/helpers/rest.php') diff --git a/modules/rest/helpers/rest.php b/modules/rest/helpers/rest.php index 58943700..9406e209 100644 --- a/modules/rest/helpers/rest.php +++ b/modules/rest/helpers/rest.php @@ -104,7 +104,7 @@ class rest_Core { if (!$key->loaded()) { $key->user_id = identity::active_user()->id; - $key->access_key = md5(md5(uniqid(mt_rand(), true) . access::private_key())); + $key->access_key = md5(random::hash() . access::private_key()); $key->save(); } -- cgit v1.2.3 From 161a85d3f5a6e8ed5835b901eb1d08e07e40be81 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Thu, 16 Dec 2010 20:37:44 -0800 Subject: Enable profiling output in the HTML output for REST. Fixes #1535. --- modules/rest/helpers/rest.php | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'modules/rest/helpers/rest.php') diff --git a/modules/rest/helpers/rest.php b/modules/rest/helpers/rest.php index 9406e209..676c10c3 100644 --- a/modules/rest/helpers/rest.php +++ b/modules/rest/helpers/rest.php @@ -54,6 +54,11 @@ class rest_Core { $html = t("Empty response"); } print "
$html
"; + if (Session::instance()->get("profiler", false)) { + Profiler::enable(); + $profiler = new Profiler(); + $profiler->render(); + } break; default: -- cgit v1.2.3