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

Prevent PHP Error on $this->load->spark(array('spark1', 'spark2')); #15

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open

Conversation

mikedfunk
Copy link

When loading multiple sparks via a passed array, MY_Loader.php will throw a PHP error:

A PHP Error was encountered
Severity: Warning

Message: ltrim() expects parameter 1 to be string, array given

Filename: core/MY_Loader.php

Line Number: 101

Backtrace:

File: /Library/WebServer/Documents/bookymark/application/core/MY_Loader.php
Line: 101
Function: ltrim

// etc. etc...

In the beginning of function spark($spark), if $spark is an array, it runs spark($spark) for each array item. However it continues processing the spark load as if it's a single item after that, which makes PHP mad. A simple "else" thrown in fixes this problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant