Page MenuHomePhorge

D25605.1734718416.diff
No OneTemporary

D25605.1734718416.diff

diff --git a/src/infrastructure/markup/markuprule/PhutilRemarkupHexColorCodeRule.php b/src/infrastructure/markup/markuprule/PhutilRemarkupHexColorCodeRule.php
--- a/src/infrastructure/markup/markuprule/PhutilRemarkupHexColorCodeRule.php
+++ b/src/infrastructure/markup/markuprule/PhutilRemarkupHexColorCodeRule.php
@@ -9,10 +9,13 @@
public function apply($text) {
// Match {#FFFFFF}
- return preg_replace_callback(
- '@\B\{(#([0-9a-fA-F]{3}){1,2})\}@',
- array($this, 'markupHexColorCodedText'),
- $text);
+ if (is_string($text)) {
+ return preg_replace_callback(
+ '@\B\{(#([0-9a-fA-F]{3}){1,2})\}@',
+ array($this, 'markupHexColorCodedText'),
+ $text);
+ }
+ return $text;
}
protected function contrastingColor($color_code) {
diff --git a/src/infrastructure/markup/markuprule/PhutilRemarkupRule.php b/src/infrastructure/markup/markuprule/PhutilRemarkupRule.php
--- a/src/infrastructure/markup/markuprule/PhutilRemarkupRule.php
+++ b/src/infrastructure/markup/markuprule/PhutilRemarkupRule.php
@@ -18,6 +18,12 @@
return 500.0;
}
+ /**
+ * Check input whether to apply RemarkupRule. If true, apply formatting.
+ * @param string|PhutilSafeHTML String to check and potentially format.
+ * @return string|PhutilSafeHTML Unchanged input if no match, or input after
+ * matching the formatting rule and applying the formatting.
+ */
abstract public function apply($text);
public function getPostprocessKey() {

File Metadata

Mime Type
text/plain
Expires
Fri, Dec 20, 18:13 (11 h, 17 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1019033
Default Alt Text
D25605.1734718416.diff (1 KB)

Event Timeline