Page Menu
Home
In-Portal Phabricator
Search
Configure Global Search
Log In
Files
F1167470
D492.id.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Tue, Sep 23, 12:42 PM
Size
2 KB
Mime Type
text/x-diff
Expires
Wed, Sep 24, 12:42 PM (20 h, 33 m)
Engine
blob
Format
Raw Data
Handle
756223
Attached To
D492: INP-1882 - Rework URL-encoding in Debugger Report file URLs
D492.id.diff
View Options
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
Log In to Comment