File tree 2 files changed +9
-10
lines changed
2 files changed +9
-10
lines changed Original file line number Diff line number Diff line change 5
5
use Enqueue \Client \MessagePriority ;
6
6
use Enqueue \Client \ProducerInterface ;
7
7
use Enqueue \Client \TraceableProducer ;
8
+ use Enqueue \Util \JSON ;
8
9
use Symfony \Component \HttpFoundation \Request ;
9
10
use Symfony \Component \HttpFoundation \Response ;
10
11
use Symfony \Component \HttpKernel \DataCollector \DataCollector ;
@@ -65,19 +66,13 @@ public function prettyPrintPriority($priority)
65
66
}
66
67
67
68
/**
68
- * @param string $message
69
+ * @param mixed $body
69
70
*
70
71
* @return string
71
72
*/
72
- public function prettyPrintMessage ( $ message )
73
+ public function ensureString ( $ body )
73
74
{
74
- if (is_scalar ($ message )) {
75
- return htmlspecialchars ($ message );
76
- }
77
-
78
- return htmlspecialchars (
79
- json_encode ($ message , JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE )
80
- );
75
+ return is_string ($ body ) ? $ body : JSON ::encode ($ body );
81
76
}
82
77
83
78
/**
Original file line number Diff line number Diff line change 44
44
<td >{{ sentMessage .topic }}</td >
45
45
<td style =" width: 70%" >
46
46
<span class =" metadata" >
47
- <span >{{ sentMessage .body [0:40 ] }}... </span ><a class =" btn btn-link text-small sf-toggle" data-toggle-selector =" #message-body-{{ loop .index }}" data-toggle-alt-content =" Hide trace" >Show trace</a >
47
+ <span >
48
+ {{ collector.ensureString (sentMessage .body )[0:40 ] }}{% if collector.ensureString (sentMessage .body )[0:40 ] != collector.ensureString (sentMessage .body ) %}.
49
+ ..{% endif %}
50
+ </span >
51
+ <a class =" btn btn-link text-small sf-toggle" data-toggle-selector =" #message-body-{{ loop .index }}" data-toggle-alt-content =" Hide trace" >Show trace</a >
48
52
49
53
<div id =" message-body-{{ loop .index }}" class =" context sf-toggle-content sf-toggle-hidden" >
50
54
{{ profiler_dump(sentMessage .body ) }}
You can’t perform that action at this time.
0 commit comments