Revision e8d78e7b-b49a-47df-bed8-dbca226471a5 - Code Golf Stack Exchange

# [05AB1E](http://github.com/Adriandmen/05AB1E), 30 bytes

 ׫R³«U×S»©X»D»Xr»Xi000¬»D»000»

17 bytes for the actual challenge and 13 bytes for the special case.

**Explanation**

 × # create a string of the correct nr of horizontal chars
 «R³« # add the corner char on both sides
 U # store in X
 × # create a string of the correct nr of vertical chars
 S» # split into list and join on newline creating a vertical string
 © # store this in register and keep on stack
 X» # join horizontal part and vertical part on newline
 D» # duplicate and join on newline
 Xr» # join a last horizontal string in the beginning

**Special case code**

 Xi000¬»D»000»

[Try it online!](http://05ab1e.tryitonline.net/#code=w5fCq1LCs8KrVcOXU8K7wqlYwrtEwrtYcsK7WGkwMDDCrMK7RMK7MDAwwrs&input=LQo1CisKMgp8)

AltStyle によって変換されたページ (->オリジナル) /