Fixed resolveDynamicClass when $class is empty

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:
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.
 
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.
Thank you.

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