Welcome Guest, Not a member yet? Register   Sign In
codeigniter security extend not working, overwrite csrf_show_error message
#1

I had posted in this

http://stackoverflow.com/questions/27914...or-message

Hope to see solution on this issue, I don't want to change the core file.

Thanks!
Reply
#2

The answer has been posted there:

Quote:libraries/MY_Security.php is wrong path it must be in core folder > core/MY_Security.php

The security library moved to core in 2011, so your extension has to be in application/core, not application/libraries.
Reply
#3

Someone need to update the library:

http://www.codeigniter.com/user_guide/ge...aries.html

Extending Native Libraries

If all you need to do is add some functionality to an existing library - perhaps add a function or two - then it's overkill to replace the entire library with your version. In this case it's better to simply extend the class. Extending a class is nearly identical to replacing a class with a couple exceptions:

The class declaration must extend the parent class.
Your new class name and filename must be prefixed with MY_ (this item is configurable. See below.).
For example, to extend the native Email class you'll create a file named application/libraries/MY_Email.php, and declare your class with:

It should be core folder not library library or there is depending on certain library???
Reply
#4

The Security class is located in system/core/Security.php
The Email class is located in system/libraries/Email.php

See the difference?
Reply
#5

(This post was last modified: 01-14-2015, 02:36 AM by tkao23. Edit Reason: explain more )

OK. I see it now. Maybe the documentation can make it more clear for new user?

Can include the core and library link in both page will be helpful
http://www.codeigniter.com/user_guide/ge...asses.html

For me, I have no idea what is core and what is library. And inside the autoload.php, it is included in the libraries
$autoload['libraries'] = array('security');

So having the explanation for both is much appreciated.
Reply
#6

(01-14-2015, 02:33 AM)tkao23 Wrote: OK. I see it now. Maybe the documentation can make it more clear for new user?

Can include the core and library link in both page will be helpful
http://www.codeigniter.com/user_guide/ge...asses.html

For me, I have no idea what is core and what is library. And inside the autoload.php, it is included in the libraries
$autoload['libraries'] = array('security');

So having the explanation for both is much appreciated.

Um no ... you shouldn't place it anywhere in autoload.php. Core classes are ALWAYS loaded, because the framework itself depends on them. That's the difference between a 'core' library and a regular one, and this is explained at the very top of the last link you posted.

I guess a link could be added to the docs though.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB