View Issue Details

This bug affects 1 person(s).
 2
IDProjectCategoryView StatusLast Update
06340Bug reportsOtherpublic2012-07-25 15:43
Reportersammousa Assigned Toc_schmitz  
PriorityhighSeveritypartial_block 
Status closedResolutionfixed 
Product Version2.00RC4 
Fixed in Version1.92+ 
Summary06340: String offset cast occured
Description

PHP notice

String offset cast occured

/home/sam/limesurvey/application/helpers/common_helper.php(4691)

4679 $fields=array_map('CSVUnquote',$fields);
4680 return $fields;
4681 }
4682
4683 function createPassword()
4684 {
4685 $pwchars = "abcdefhjmnpqrstuvwxyz23456789";
4686 $password_length = 8;
4687 $passwd = '';
4688
4689 for ($i=0; $i<$password_length; $i++)
4690 {
4691 $passwd .= $pwchars[floor(rand(0,strlen($pwchars)-1))];
4692 }
4693 return $passwd;
4694 }
4695
4696 function languageDropdown($surveyid,$selected)
4697 {
4698
4699 $homeurl = Yii::app()->getConfig('homeurl');
4700 $slangs = Survey::model()->findByPk($surveyid)->additionalLanguages;
4701 $baselang = Survey::model()->findByPk($surveyid)->language;
4702 array_unshift($slangs,$baselang);
4703 $html = "<select class='listboxquestions' name='langselect' onchange=\"window.open(this.options[this.selectedIndex].value, '_top')\">\n";

Stack Trace
#0

/home/sam/limesurvey/application/controllers/admin/useraction.php(103): createPassword()

098 elseif (User::model()->find("users_name='$new_user'")) {
099 $aViewUrls['message'] = array('title' => $clang->gT("Failed to add user"), 'message' => $clang->gT("The username already exists."), 'class'=> 'warningheader');
100 }
101 elseif ($valid_email)
102 {
103 $new_pass = createPassword();
104 $iNewUID = User::model()->insertUser($new_user, $new_pass, $new_full_name, Yii::app()->session['loginID'], $new_email);
105
106 if ($iNewUID) {
107 // add default template to template rights for user
108 Templates_rights::model()->insertRecords(array('uid' => $iNewUID, 'folder' => 'default', 'use' => '1'));

#1
unknown(0): UserAction->adduser()
#2
+
/home/sam/limesurvey/framework/web/actions/CAction.php(107): ReflectionMethod->invokeArgs(UserAction, array())
#3

/home/sam/limesurvey/application/core/Survey_Common_Action.php(82): CAction->runWithParamsInternal(UserAction, ReflectionMethod, array("url" => "/admin/user/adduser", "sa" => "adduser"))

77 $oMethod = new ReflectionMethod($this, $sDefault);
78 }
79
80 // We're all good to go, let's execute it
81 // runWithParamsInternal would automatically get the parameters of the method and populate them as required with the params
82 return parent::runWithParamsInternal($this, $oMethod, $params);
83 }
84
85 /*
86
Some functions have different parameters, which are just an alias of the
87 * usual parameters we're getting in the url. This function just populates

#4
+
/home/sam/limesurvey/framework/web/CController.php(309): Survey_Common_Action->runWithParams(array("url" => "/admin/user/adduser", "sa" => "adduser"))
#5
+
/home/sam/limesurvey/framework/web/CController.php(287): CController->runAction(UserAction)
#6
+
/home/sam/limesurvey/framework/web/CController.php(266): CController->runActionWithFilters(UserAction, array())
#7

/home/sam/limesurvey/application/controllers/AdminController.php(158): CController->run("user")

153 Yii::app()->session['redirectopage'] = Yii::app()->request->requestUri;
154
155 $this->redirect($this->createUrl('/admin/authentication/login'));
156 }
157
158 return parent::run($action);
159 }
160
161 /*
162
Routes all the actions to their respective places
163 *

#8
+
/home/sam/limesurvey/framework/web/CWebApplication.php(276): AdminController->run("user")
#9
+
/home/sam/limesurvey/framework/web/CWebApplication.php(135): CWebApplication->runController("admin/user/sa/adduser")
#10
+
/home/sam/limesurvey/framework/base/CApplication.php(162): CWebApplication->processRequest()
#11
+
/home/sam/limesurvey/index.php(171): CApplication->run()
2012-07-19 10:47:32 nginx/1.1.19 Yii Framework/1.1.10

Steps To Reproduce
  • Login via administrative interface
  • Add a new survey administrator details, click add user.
Additional Information

http://mark-story.com/posts/view/new-errors-in-php-5-4/

TagsNo tags attached.
Bug heat2
Complete LimeSurvey version number (& build)120622
I will donate to the project if issue is resolvedNo
Browser
Database type & versionmysql 5.5.24-0ubuntu0.12.04.1
Server OS (if known)Ubuntu 12.04
Webserver software & version (if known)nginx 1.1.19-1
PHP Version5.4.4.1

Users monitoring this issue

There are no users monitoring this issue.

Activities

c_schmitz

c_schmitz

2012-07-20 10:47

administrator   ~19862

Fix committed to Yii branch: http://bugs.limesurvey.org/plugin.php?page=Source/view&amp;id=9061

c_schmitz

c_schmitz

2012-07-20 10:48

administrator   ~19863

Fix committed to master branch: http://bugs.limesurvey.org/plugin.php?page=Source/view&amp;id=9062

Related Changesets

LimeSurvey: Yii b0d05ece

2012-07-20 01:47:28

c_schmitz

Details Diff
Fixed issue 06340: Error "String offset cast occured" when adding user and using PHP 5.4 or later Affected Issues
06340
mod - application/helpers/common_helper.php Diff File

LimeSurvey: master 7cf77c04

2012-07-20 01:47:50

c_schmitz

Details Diff
Fixed issue 06340: Error "String offset cast occured" when adding user and using PHP 5.4 or later Affected Issues
06340
mod - common_functions.php Diff File

Issue History

Date Modified Username Field Change
2012-07-19 12:58 sammousa New Issue
2012-07-20 10:47 c_schmitz Changeset attached => LimeSurvey Yii b0d05ece
2012-07-20 10:47 c_schmitz Note Added: 19862
2012-07-20 10:47 c_schmitz Assigned To => c_schmitz
2012-07-20 10:47 c_schmitz Resolution open => fixed
2012-07-20 10:48 c_schmitz Changeset attached => LimeSurvey master 7cf77c04
2012-07-20 10:48 c_schmitz Note Added: 19863
2012-07-20 10:48 c_schmitz Status new => resolved
2012-07-20 10:48 c_schmitz Fixed in Version => 1.92+
2012-07-25 15:43 c_schmitz Status resolved => closed