Page MenuHomeIn-Portal Phabricator

D492.diff
No OneTemporary

File Metadata

Created
Sun, Feb 23, 6:24 PM

D492.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
@@ -390,13 +390,6 @@
private $_isAjax = false;
/**
- * Data, parsed from the editor url.
- *
- * @var array
- */
- protected $editorUrlData = array('url' => '', 'params' => array());
-
- /**
* Creates instance of debugger
*/
public function __construct()
@@ -504,28 +497,6 @@
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'];
-
- if ( isset($components['path']) ) {
- $this->editorUrlData['url'] .= $components['path'];
- }
-
- if ( isset($components['query']) ) {
- parse_str(html_entity_decode($components['query']), $this->editorUrlData['params']);
- }
}
/**
@@ -1033,22 +1004,17 @@
*/
public function getFileLink($file, $line_number = 1, $title = '')
{
- if ( !$title ) {
- $title = str_replace('/', '\\', $this->getLocalFile($file));
- }
-
$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
- );
+ if ( !$title ) {
+ $title = str_replace('/', '\\', $local_file);
}
- $url = $this->editorUrlData['url'] . '?' . http_build_query($url_params);
+ $url = str_ireplace(
+ array('%F', '%L'),
+ array(urlencode($local_file), urlencode($line_number)),
+ DBG_EDITOR_URL
+ );
return '<a href="' . $url . '">' . $title . '</a>';
}

Event Timeline