summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsalvis2012-06-01 23:24:33 (GMT)
committersalvis2012-06-01 23:24:33 (GMT)
commitefd64762daed7100629395845400e1ef73ded626 (patch)
treeaff70eb2d2167b2c907e25a9a86565b0bfef9523
parent45cc6e33b6fbd628d0666068455f76924d3406da (diff)
Issue #1345240 by random720: Avoid breaking XHProf reporting when site name contains spaces.6.x-1.27
-rw-r--r--devel.module8
1 files changed, 6 insertions, 2 deletions
diff --git a/devel.module b/devel.module
index 235bd8f..dd68bab 100644
--- a/devel.module
+++ b/devel.module
@@ -876,8 +876,12 @@ function devel_shutdown_real() {
devel_store_queries();
}
+function devel_xhprof_get_namespace() {
+ return str_replace(array(' ', '\''), '', variable_get('site_name', 'devel'));
+}
+
function devel_shutdown_xhprof() {
- $namespace = variable_get('site_name', ''); // namespace for your application
+ $namespace = devel_xhprof_get_namespace(); // namespace for your application
$xhprof_data = xhprof_disable();
$xhprof_runs = new XHProfRuns_Default();
return $xhprof_runs->save_run($xhprof_data, $namespace);
@@ -1749,7 +1753,7 @@ function devel_xhprof_link_show() {
function devel_xhprof_link($run_id, $type = 'link') {
// @todo: render results from within Drupal.
$xhprof_url = variable_get('devel_xhprof_url', '');
- $namespace = variable_get('site_name', ''); // namespace for your application
+ $namespace = devel_xhprof_get_namespace(); // namespace for your application
if ($xhprof_url) {
$url = $xhprof_url . "/index.php?run=$run_id&source=$namespace";
return $type == 'url' ? $url : t('<a href="@xhprof">XHProf output</a>. ', array('@xhprof' => $url));