View Issue Details

This issue affects 1 person(s).
 2
IDProjectCategoryView StatusLast Update
18002Bug reportsTheme editorpublic2022-03-31 17:19
Reporterritapas Assigned Toollehar  
PrioritynoneSeverityblock 
Status closedResolutionno change required 
Product Version5.x 
Summary18002: Cannot extend theme
Description

Action Extend Theme triggers unhandled error
Call to undefined function mb_ereg_replace()

/var/www/html/limesurvey5/application/helpers/sanitize_helper.php(122)

Steps To Reproduce

Steps to reproduce

Login, go to theme editor. Extend the Fruity theme and give name "extends_fruity"

Expected result

Extended theme "extends_fruity" is created and opened inside theme error

Actual result

Error

Call to undefined function mb_ereg_replace()

/var/www/html/limesurvey5/application/helpers/sanitize_helper.php(122)

110 /*
111
Function: sanitize_filename
112 Returns a sanitized string, typically for URLs.
113

114 Parameters:
115
$string - The string to sanitize.
116 $force_lowercase - Force the string to lowercase?
117
$alphanumeric - If set to true, will remove all non-alphanumeric characters.
118 /
119 function sanitize_filename($filename, $force_lowercase = true, $alphanumeric = false, $beautify = true)
120 {
121 // sanitize filename
122 $filename = mb_ereg_replace(
123 '[<>:"\|?
]|
124 [\x00-\x1F]|
125 [\x7F\xA0\xAD]|
126 [#[]@!$&\'()+,;=]|
127 [{}^\~`]',
128 '-',
129 $filename
130 );
131 // Removes smart quotes
132 $filename = str_replace(array("\xe2\x80\x98", "\xe2\x80\x99", "\xe2\x80\x9c", "\xe2\x80\x9d", "\xe2\x80\x93", "\xe2\x80\x94", "\xe2\x80\xa6"), array('','', '', '', '-', '--','...'), $filename);
133 // avoids ".", ".." or ".hiddenFiles"
134 $filename = ltrim($filename, '.-');

Stack Trace
#0

/var/www/html/limesurvey5/application/helpers/sanitize_helper.php(192): sanitize_filename("vanilla", false, false, false)

187 */
188
189 function sanitize_dirname($string, $force_lowercase = false, $alphanumeric = false)
190 {
191 $string = str_replace(".", "", $string);
192 return sanitize_filename($string, $force_lowercase, $alphanumeric, false);
193 }
194
195
196 // paranoid sanitization -- only let the alphanumeric set through
197 function sanitize_paranoid_string($string, $min = '', $max = '')

#1

/var/www/html/limesurvey5/application/controllers/admin/Themes.php(688): sanitize_dirname("vanilla")

683 @access public
684
@return void
685 */
686 public function templatecopy()
687 {
688 $copydir = sanitize_dirname(Yii::app()->request->getPost("copydir"));
689
690 if (Permission::model()->hasGlobalPermission('templates', 'create')) {
691 $newname = sanitize_dirname(Yii::app()->request->getPost("newname"));
692
693 Yii::import('application.helpers.SurveyThemeHelper');

#2
unknown(0): Themes->templatecopy()
#3
+
/var/www/html/limesurvey5/framework/web/actions/CAction.php(115): ReflectionMethod->invokeArgs(Themes, array())
#4

/var/www/html/limesurvey5/application/core/SurveyCommonAction.php(83): CAction->runWithParamsInternal(Themes, ReflectionMethod, array("sa" => "templatecopy", "sAction" => "templatecopy"))

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

#5
+
/var/www/html/limesurvey5/application/controllers/admin/Themes.php(31): SurveyCommonAction->runWithParams(array("sa" => "templatecopy", "sAction" => "templatecopy"))
#6
+
/var/www/html/limesurvey5/framework/web/CController.php(308): Themes->runWithParams(array("sa" => "templatecopy"))
#7
+
/var/www/html/limesurvey5/framework/web/CController.php(286): CController->runAction(Themes)
#8
+
/var/www/html/limesurvey5/framework/web/CController.php(265): CController->runActionWithFilters(Themes, array())
#9
+
/var/www/html/limesurvey5/application/controllers/AdminController.php(202): CController->run("themes")
#10
+
/var/www/html/limesurvey5/framework/web/CWebApplication.php(282): AdminController->run("themes")
#11
+
/var/www/html/limesurvey5/framework/web/CWebApplication.php(141): CWebApplication->runController("admin/themes/sa/templatecopy")
#12
+
/var/www/html/limesurvey5/framework/base/CApplication.php(185): CWebApplication->processRequest()
#13
+
/var/www/html/limesurvey5/index.php(192): CApplication->run()

TagsNo tags attached.
Attached Files
Bug heat2
Complete LimeSurvey version number (& build) 5.3.5 (build 220314)
I will donate to the project if issue is resolvedNo
BrowserMozilla Firefox
Database type & versionpostgresql13-server-13.6
Server OS (if known)CentOS Linux release 8.5.2111
Webserver software & version (if known)httpd-2.4.37-43
PHP Versionphp-7.2.24

Users monitoring this issue

There are no users monitoring this issue.

Activities

ritapas

ritapas

2022-03-31 15:30

reporter   ~68839

my falut, mbstring library was missing

Issue History

Date Modified Username Field Change
2022-03-31 15:19 ritapas New Issue
2022-03-31 15:19 ritapas File Added: Screenshot 2022-03-31 at 15-10-06 Error.png
2022-03-31 15:30 ritapas Note Added: 68839
2022-03-31 15:30 ritapas Bug heat 0 => 2
2022-03-31 17:19 ollehar Assigned To => ollehar
2022-03-31 17:19 ollehar Status new => closed
2022-03-31 17:19 ollehar Resolution open => no change required