1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Fixed resolveDynamicClass when $class is empty

Discussion in 'Resolved Bug Reports' started by xfrocks, Aug 9, 2013.

  1. xfrocks

    xfrocks Well-Known Member

    Fatal error will occur if both of these happens:
    • Some add-on (#1) use responseView without a view class
    • Some other add-on (#2) use load_class_view to extend the empty view class (I know it doesn't make sense but it's possible to do that)
    Explain:

    For views, when $class is missing, $fakeNeeded will be set to true. Add-on #2 wants to extend the view, this line will run...

    PHP:
    eval('class '$class .' extends '$fakeBase .' {}');
    Because $class is empty, the eval will failed because of syntax error. Leading to further errors down the line because $createClass is also empty.
     
    Last edited: Aug 9, 2013
    nrep and Nobita.Kun like this.
  2. Mike

    Mike XenForo Developer Staff Member

    I've changed this such that the dynamic class resolution system doesn't run if $class is empty. It really doesn't make sense. The system is for extending classes based on specific ones being loaded, so doing anything to an empty class is meaningless.
     
    xfrocks likes this.
  3. xfrocks

    xfrocks Well-Known Member

    Thank you.

    Yeah, it doesn't make much sense but in this particular case I need the view object to reuse it later.
     

Share This Page