Skip to content
  • Hartley McGuire's avatar
    24213d69
    Prevent assigning internal ivars to AV::Base · 24213d69
    Hartley McGuire authored
    
    
    Previously, both the `@rendered_format` and
    `@marked_for_same_origin_verification` instance variables would be
    assigned to instances of `ActionView::Base`, making them accessible in
    view templates. However, these instance variables are really internal to
    the controller and result in extra string allocations because the `@`
    gets stripped and readded when going through the assignment.
    
    This commit prefixes the variables with an underscore to help indicate
    that they are internal, and then adds them to the list of
    `_protected_ivars` to prevent assigning them when rendering templates.
    
    Co-authored-by: default avatarJean Boussier <jean.boussier@gmail.com>
    Co-authored-by: default avatarJonathan Hefner <jonathan@hefner.pro>
    24213d69
    Prevent assigning internal ivars to AV::Base
    Hartley McGuire authored
    
    
    Previously, both the `@rendered_format` and
    `@marked_for_same_origin_verification` instance variables would be
    assigned to instances of `ActionView::Base`, making them accessible in
    view templates. However, these instance variables are really internal to
    the controller and result in extra string allocations because the `@`
    gets stripped and readded when going through the assignment.
    
    This commit prefixes the variables with an underscore to help indicate
    that they are internal, and then adds them to the list of
    `_protected_ivars` to prevent assigning them when rendering templates.
    
    Co-authored-by: default avatarJean Boussier <jean.boussier@gmail.com>
    Co-authored-by: default avatarJonathan Hefner <jonathan@hefner.pro>
Loading