You've already forked phpmyadmin
mirror of
https://github.com/phpmyadmin/phpmyadmin.git
synced 2026-10-29 21:24:44 +03:00
Let's have just one PMA_mimeDefaultFunction
Signed-off-by: Michal Čihař <michal@cihar.com>
This commit is contained in:
@@ -2835,7 +2835,7 @@ class PMA_DisplayResults
|
||||
: false;
|
||||
|
||||
// Wrap MIME-transformations. [MIME]
|
||||
$default_function = '_mimeDefaultFunction'; // default_function
|
||||
$default_function = 'PMA_mimeDefaultFunction'; // default_function
|
||||
$transformation_plugin = $default_function;
|
||||
$transform_options = array();
|
||||
|
||||
@@ -3798,7 +3798,7 @@ class PMA_DisplayResults
|
||||
$transform_options,
|
||||
$meta
|
||||
)
|
||||
: $this->$default_function($column, array(), $meta);
|
||||
: $default_function($column, array(), $meta);
|
||||
|
||||
if ($is_field_truncated) {
|
||||
$class .= ' truncated';
|
||||
@@ -4878,7 +4878,7 @@ class PMA_DisplayResults
|
||||
$row = $GLOBALS['dbi']->fetchRow($dt_result);
|
||||
|
||||
// initializing default arguments
|
||||
$default_function = '_mimeDefaultFunction';
|
||||
$default_function = 'PMA_mimeDefaultFunction';
|
||||
$transformation_plugin = $default_function;
|
||||
$transform_options = array();
|
||||
|
||||
@@ -5561,7 +5561,7 @@ class PMA_DisplayResults
|
||||
);
|
||||
} else {
|
||||
|
||||
$result = $this->$default_function($result, array(), $meta);
|
||||
$result = $default_function($result, array(), $meta);
|
||||
if (stristr($meta->type, self::BLOB_FIELD)
|
||||
&& $_SESSION['tmpval']['display_blob']
|
||||
) {
|
||||
@@ -5697,7 +5697,7 @@ class PMA_DisplayResults
|
||||
$transform_options,
|
||||
$meta
|
||||
)
|
||||
: $this->$default_function($data)
|
||||
: $default_function($data)
|
||||
)
|
||||
. ' <code>[->' . $dispval . ']</code>';
|
||||
|
||||
@@ -5750,10 +5750,10 @@ class PMA_DisplayResults
|
||||
if ($relational_display == self::RELATIONAL_DISPLAY_COLUMN) {
|
||||
// user chose "relational display field" in the
|
||||
// display options, so show display field in the cell
|
||||
$result .= $this->$default_function($dispval);
|
||||
$result .= $default_function($dispval);
|
||||
} else {
|
||||
// otherwise display data in the cell
|
||||
$result .= $this->$default_function($data);
|
||||
$result .= $default_function($data);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -5767,7 +5767,7 @@ class PMA_DisplayResults
|
||||
$transform_options,
|
||||
$meta
|
||||
)
|
||||
: $this->$default_function($data)
|
||||
: $default_function($data)
|
||||
);
|
||||
}
|
||||
|
||||
@@ -6060,32 +6060,6 @@ class PMA_DisplayResults
|
||||
|
||||
} // end of the '_getCheckboxAndLinks()' function
|
||||
|
||||
|
||||
/**
|
||||
* Replace some html-unfriendly stuff
|
||||
*
|
||||
* @param string $buffer String to process
|
||||
*
|
||||
* @return String Escaped and cleaned up text suitable for html.
|
||||
*
|
||||
* @access private
|
||||
*
|
||||
* @see _getDataCellForBlobField(), _getRowData(),
|
||||
* _handleNonPrintableContents()
|
||||
*/
|
||||
private function _mimeDefaultFunction($buffer)
|
||||
{
|
||||
$buffer = htmlspecialchars($buffer);
|
||||
$buffer = str_replace(
|
||||
"\011",
|
||||
' ',
|
||||
str_replace(' ', ' ', $buffer)
|
||||
);
|
||||
$buffer = preg_replace("@((\015\012)|(\015)|(\012))@", '<br />', $buffer);
|
||||
|
||||
return $buffer;
|
||||
}
|
||||
|
||||
/**
|
||||
* Display binary columns as hex string if requested
|
||||
* otherwise escape the contents using the best possible way
|
||||
|
||||
@@ -1294,22 +1294,6 @@ class PMA_DisplayResults_Test extends PHPUnit_Framework_TestCase
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test for _mimeDefaultFunction
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function testMimeDefaultFunction()
|
||||
{
|
||||
$this->assertEquals(
|
||||
"A 'quote' is <b>bold</b>",
|
||||
$this->_callPrivateFunction(
|
||||
'_mimeDefaultFunction',
|
||||
array("A 'quote' is <b>bold</b>")
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Data provider for testGetPlacedLinks
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user