Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHP warning fix for the autoLoad() function #12684

Closed
wants to merge 1 commit into from

Commits on Mar 7, 2017

  1. PHP warning fix for the autoLoad() function

    This small alteration should fix this situation: https://forum.phalconphp.com/discussion/10339/strange-warning-probably-from-zephirfaststrreplace-or-something-
    
    If you have two classes:
    My\Class\Foo\Bar
    and
    My\Class\Foo
    
    When initializing Foo() the autoLoad will come to this line "let fileName = substr(className, strlen(nsPrefix . ns));" at the moment where className = "My\Class\Foo" and nsPrefix = "My\Class\Foo\Bar"
    
    At this point (could be a zephir bug) fileName is something that will make "let fileName = str_replace(ns, ds, fileName);" throw the following warning (Invalid arguments supplied for str_replace()). Either substr is returning something other than an empy string or str_replace is not allowing an empy string either way testing if fileName has any value before "let fileName = str_replace(ns, ds, fileName);" should mitigate this warning.
    satakecode authored Mar 7, 2017
    Configuration menu
    Copy the full SHA
    3e2c559 View commit details
    Browse the repository at this point in the history