mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-27 01:02:42 +01:00
Fix {Fnnn} rule in Remarkup
Summary: Remarkup rule callbacks now get SafeHTML matches instead of string matches. If they call: $some_lisk_dao->load($matches[1]); ..as is the case with the `{F123}` rule, we reject the SafeHTML as an invalid ID and return null. Allow load() to string convert any object (which will either succeed or fatal in an obviously-broken way). (Long ago we threw instead of returning null here, but it meant we had to do a lot of redundant checks.) Test Plan: `{F123}` shows an image again. `{C1}` embeds a countdown. Reviewers: vrana, chad Reviewed By: vrana CC: aran Differential Revision: https://secure.phabricator.com/D4961
This commit is contained in:
parent
fb32a64d84
commit
176ee9a889
2 changed files with 5 additions and 1 deletions
|
@ -41,7 +41,7 @@ final class PhabricatorMarkupEngine {
|
|||
|
||||
private $objects = array();
|
||||
private $viewer;
|
||||
private $version = 3;
|
||||
private $version = 4;
|
||||
|
||||
|
||||
/* -( Markup Pipeline )---------------------------------------------------- */
|
||||
|
|
|
@ -406,6 +406,10 @@ abstract class LiskDAO {
|
|||
* @task load
|
||||
*/
|
||||
public function load($id) {
|
||||
if (is_object($id)) {
|
||||
$id = (string)$id;
|
||||
}
|
||||
|
||||
if (!$id || (!is_int($id) && !ctype_digit($id))) {
|
||||
return null;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue