class_language.php cause PHP Notice on Undefined variable $controller
|
01-22-2014 02:59 PM
|
|
class_language.php cause PHP Notice on Undefined variable $controller
In some cases the $control is undefined and this can cause a PHP Notice.
Its not urgent but annoying when going thru error_log
Code:
--- v1.3.4/classes/class_language.php 2013-04-18 19:42:30.000000000 +0200
+++ src/classes/class_language.php 2014-01-21 21:26:09.000000000 +0100
@@ -105,6 +105,7 @@
*/
private function locate($file){
$mysidia = Registry::get("mysidia");
+ $controller = '';
if($mysidia->input->get("frontcontroller") != "index"){
$controller = "{$mysidia->input->get("frontcontroller")}/";
}
|
|
Issue Details
|
Category Unknown
Status Fixed
Priority 8
Affected Version Mys v1.3.4
Fixed Version Mys v1.4.0
Users able to reproduce bug
0
Users unable to reproduce bug
0
Assigned Users
(none)
Tags
(none)
|
|
01-27-2014 02:00 AM
|
|
Administrator, Lead Coder
|
|
|
Notice errors are caused by not checking the existence of variables at first. In Mys v1.3.4, the notice error ususally occurs with PHP native strings. In Mys v1.4.0, almost everything is an object so you wont get notice errors. Most people do not have notice errors enabled on their web servers though, so only users with their own servers will likely to ever receive them.
Anyway just like the OP suggested, the easiest way to get rid of notice errors is to simply define the missing variable to be an empty string or even NULL at the very beginning.
|
01-27-2014 02:48 AM
|
|
is the version 1.4.0 already available?
|
01-27-2014 05:28 AM
|
|
Administrator, Lead Coder
|
|
|
Nope, its months away from available.
|
All times are GMT -5. The time now is 05:59 AM.
Currently Active Users: 1528 (0 members and 1528 guests)
Threads: 4,081, Posts: 32,025, Members: 2,016
Welcome to our newest members,
jolob.