From ea52c30bca10c86cd67b89a54b7fbe94229f8dbb Mon Sep 17 00:00:00 2001 From: epriestley Date: Wed, 2 Jan 2013 14:03:29 -0800 Subject: [PATCH] Fix issue where "{Fnnn, size}" renders as though "size=full" Summary: We interpret "size" as "size => true", and "true == 'full'", so we hit the wrong branch in the switch(). String cast explicitly. Test Plan: Typed `{Fnnn, size}`; saw it render as a thumb instead of full. Reviewers: btrahan, codeblock Reviewed By: codeblock CC: frozendevil, aran Differential Revision: https://secure.phabricator.com/D4323 --- .../markup/rule/PhabricatorRemarkupRuleEmbedFile.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/infrastructure/markup/rule/PhabricatorRemarkupRuleEmbedFile.php b/src/infrastructure/markup/rule/PhabricatorRemarkupRuleEmbedFile.php index 7a92eada96..3b0acf5b85 100644 --- a/src/infrastructure/markup/rule/PhabricatorRemarkupRuleEmbedFile.php +++ b/src/infrastructure/markup/rule/PhabricatorRemarkupRuleEmbedFile.php @@ -50,7 +50,7 @@ final class PhabricatorRemarkupRuleEmbedFile $options['name'] = $file_name; $attrs = array(); - switch ($options['size']) { + switch ((string)$options['size']) { case 'full': $attrs['src'] = $file->getBestURI(); $options['image_class'] = null;