Page MenuHomeIn-Portal Phabricator

D113.id.diff
No OneTemporary

File Metadata

Created
Thu, Feb 6, 9:55 PM

D113.id.diff

Index: branches/5.3.x/core/kernel/utility/debugger.php
===================================================================
--- branches/5.3.x/core/kernel/utility/debugger.php
+++ branches/5.3.x/core/kernel/utility/debugger.php
@@ -383,6 +383,13 @@
private $_isAjax = false;
/**
+ * Data, parsed from the editor url.
+ *
+ * @var array
+ */
+ protected $editorUrlData = array('url' => '', 'params' => array());
+
+ /**
* Creates instance of debugger
*/
public function __construct()
@@ -489,6 +496,24 @@
foreach ($dbg_constMap as $dbg_constName => $dbg_constValue) {
DebuggerUtil::safeDefine($dbg_constName, $dbg_constValue);
}
+
+ $this->parseEditorUrl();
+ }
+
+ /**
+ * Parses editor url.
+ *
+ * @return void
+ */
+ protected function parseEditorUrl()
+ {
+ $components = parse_url(DBG_EDITOR_URL);
+
+ $this->editorUrlData['url'] = $components['scheme'] . '://' . $components['host'] . $components['path'];
+
+ if ( isset($components['query']) ) {
+ parse_str(html_entity_decode($components['query']), $this->editorUrlData['params']);
+ }
}
/**
@@ -986,8 +1011,18 @@
$title = str_replace('/', '\\', $this->getLocalFile($file));
}
- $url = str_replace('%F', $this->getLocalFile($file), DBG_EDITOR_URL);
- $url = str_replace('%L', $line_number, $url);
+ $local_file = $this->getLocalFile($file);
+ $url_params = $this->editorUrlData['params'];
+
+ foreach ( $url_params as $param_name => $param_value ) {
+ $url_params[$param_name] = str_replace(
+ array('%F', '%L'),
+ array($local_file, $line_number),
+ $param_value
+ );
+ }
+
+ $url = $this->editorUrlData['url'] . '?' . http_build_query($url_params);
return '<a href="' . $url . '">' . $title . '</a>';
}
@@ -2086,4 +2121,4 @@
if ( DebuggerUtil::constOn('DBG_USE_SHUTDOWN_FUNC') ) {
register_shutdown_function(array(&$debugger, 'printReport'), false, true, true);
}
- }
\ No newline at end of file
+ }

Event Timeline