Differential D25186 Diff 666 src/applications/files/document/render/PhabricatorDocumentRenderingEngine.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/files/document/render/PhabricatorDocumentRenderingEngine.php
Show First 20 Lines • Show All 54 Lines • ▼ Show 20 Lines | final public function newDocumentView(PhabricatorDocumentRef $ref) { | ||||
$engine = $engines[$engine_key]; | $engine = $engines[$engine_key]; | ||||
$lines = $this->getSelectedLineRange(); | $lines = $this->getSelectedLineRange(); | ||||
if ($lines) { | if ($lines) { | ||||
$engine->setHighlightedLines(range($lines[0], $lines[1])); | $engine->setHighlightedLines(range($lines[0], $lines[1])); | ||||
} | } | ||||
$encode_setting = $request->getStr('encode'); | $encode_setting = $request->getStr('encode'); | ||||
if (strlen($encode_setting)) { | if (phutil_nonempty_string($encode_setting)) { | ||||
valerio.bozzolan: ✅ I verified the above line
The `Aphront#getStr()` only returns strings, or null (default). | |||||
$engine->setEncodingConfiguration($encode_setting); | $engine->setEncodingConfiguration($encode_setting); | ||||
} | } | ||||
$highlight_setting = $request->getStr('highlight'); | $highlight_setting = $request->getStr('highlight'); | ||||
if (strlen($highlight_setting)) { | if (phutil_nonempty_string($highlight_setting)) { | ||||
Done Inline Actions✅ I verified the above line The Aphront#getStr() only returns strings, or null (default). The function phutil_nonempty_string() will report other alien types, and that is OK. valerio.bozzolan: ✅ I verified the above line
The `Aphront#getStr()` only returns strings, or null (default). | |||||
$engine->setHighlightingConfiguration($highlight_setting); | $engine->setHighlightingConfiguration($highlight_setting); | ||||
} | } | ||||
$blame_setting = ($request->getStr('blame') !== 'off'); | $blame_setting = ($request->getStr('blame') !== 'off'); | ||||
$engine->setBlameConfiguration($blame_setting); | $engine->setBlameConfiguration($blame_setting); | ||||
$views = array(); | $views = array(); | ||||
foreach ($engines as $candidate_key => $candidate_engine) { | foreach ($engines as $candidate_key => $candidate_engine) { | ||||
▲ Show 20 Lines • Show All 268 Lines • Show Last 20 Lines |
Content licensed under Creative Commons Attribution-ShareAlike 4.0 (CC-BY-SA) unless otherwise noted; code licensed under Apache 2.0 or other open source licenses. · CC BY-SA 4.0 · Apache 2.0
✅ I verified the above line
The Aphront#getStr() only returns strings, or null (default).
The function phutil_nonempty_string() will report other alien types, and that is OK.