Page Menu
Home
In-Portal Phabricator
Search
Configure Global Search
Log In
Files
F1403598
D262.id648.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
Wed, Feb 25, 7:49 AM
Size
810 B
Mime Type
text/x-diff
Expires
Thu, Feb 26, 7:49 AM (11 h, 13 m)
Engine
blob
Format
Raw Data
Handle
899769
Attached To
D262: INP-1640 - Use "current" function only on arrays in "kDBConnectionDebug::GetIterator" method
D262.id648.diff
View Options
Index: branches/5.2.x/core/kernel/db/db_connection.php
===================================================================
--- branches/5.2.x/core/kernel/db/db_connection.php
+++ branches/5.2.x/core/kernel/db/db_connection.php
@@ -1082,7 +1082,19 @@
// set 2nd checkpoint: begin
if ( $this->_profileSQLs ) {
- $first_cell = count($ret) == 1 && $ret->fieldCount() == 1 ? current($ret->current()) : null;
+ $current_row = $ret->current();
+
+ if ( count($ret) == 1 && $ret->fieldCount() == 1 ) {
+ if ( is_array($current_row) ) {
+ $first_cell = current($current_row);
+ }
+ else {
+ $first_cell = $current_row;
+ }
+ }
+ else {
+ $first_cell = null;
+ }
if ( strlen($first_cell) > 200 ) {
$first_cell = substr($first_cell, 0, 50) . ' ...';
Event Timeline
Log In to Comment