소스 검색

[FrameworkBundle] router:debug - better string dumping to avoid namespace escaping

Before this change, the var_export causes namespaces to be escaped:

Before: 'Symfony\\Component\\...'
After:  Symfony\Component\...
Ryan Weaver 14 년 전
부모
커밋
409df12a36
1개의 변경된 파일4개의 추가작업 그리고 0개의 파일을 삭제
  1. 4 0
      src/Symfony/Bundle/FrameworkBundle/Command/RouterDebugCommand.php

+ 4 - 0
src/Symfony/Bundle/FrameworkBundle/Command/RouterDebugCommand.php

@@ -161,6 +161,10 @@ EOF
             return sprintf('object(%s)', get_class($value));
         }
 
+        if (is_string($value)) {
+            return $value;
+        }
+
         return preg_replace("/\n\s*/s", '', var_export($value, true));
     }
 }