Skip to content

Commit

Permalink
fixed issue 04420: group.php will strip out {QUESTION_ESSENTIALS} if …
Browse files Browse the repository at this point in the history
…it appears at the very first part of the template in dev branch

Dev used preg_match() instead of strpos() to over come stripping of {QUESTION_ESSENTIALS}
Dev strip out {QUESTION_CLASS} if {QUESTION_ESSENTIALS} is missing.
Dev this issue applies to group.php, question.php and survey.php so all have been updated.


git-svn-id: file:///Users/Shitiz/Downloads/lssvn/source/limesurvey_dev@8911 b72ed6b6-b9f8-46b5-92b4-906544132732
  • Loading branch information
Evan Wills committed Jul 7, 2010
1 parent 62af773 commit 2dca2e3
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
3 changes: 2 additions & 1 deletion group.php
Expand Up @@ -1107,10 +1107,11 @@ function checkconditions(value, name, type)

$question_template = file_get_contents($thistpl.'/question.pstpl');

if( (strpos( $question_template , '{QUESTION_ESSENTIALS}') == false) || (strpos( $question_template , '{QUESTION_CLASS}') == false) )
if( preg_match( '/\{QUESTION_ESSENTIALS\}/' , $question_template ) === false || preg_match( '/\{QUESTION_CLASS\}/' , $question_template ) === false )
{
// if {QUESTION_ESSENTIALS} is present in the template but not {QUESTION_CLASS} remove it because you don't want id="" and display="" duplicated.
$question_template = str_replace( '{QUESTION_ESSENTIALS}' , '' , $question_template );
$question_template = str_replace( '{QUESTION_CLASS}' , '' , $question_template );
echo '
<!-- NEW QUESTION -->
<div id="question'.$qa[4].'" class="'.$q_class.$man_class.'"'.$n_q_display.'>
Expand Down
3 changes: 2 additions & 1 deletion question.php
Expand Up @@ -514,10 +514,11 @@

$question_template = file_get_contents($thistpl.'/question.pstpl');

if( (strpos( $question_template , '{QUESTION_ESSENTIALS}') == false) || (strpos( $question_template , '{QUESTION_CLASS}') == false) )
if( preg_match( '/\{QUESTION_ESSENTIALS\}/' , $question_template ) === false || preg_match( '/\{QUESTION_CLASS\}/' , $question_template ) === false )
{
// if {QUESTION_ESSENTIALS} is present in the template but not {QUESTION_CLASS} remove it because you don't want id="" and display="" duplicated.
$question_template = str_replace( '{QUESTION_ESSENTIALS}' , '' , $question_template );
$question_template = str_replace( '{QUESTION_CLASS}' , '' , $question_template );
echo '
<!-- NEW QUESTION -->
<div id="question'.$qa[4].'" class="'.$q_class.$man_class.'"'.$n_q_display.'>
Expand Down
5 changes: 3 additions & 2 deletions survey.php
Expand Up @@ -904,10 +904,11 @@ function checkconditions(value, name, type)

$question_template = file_get_contents($thistpl.'/question.pstpl');

if( (strpos( $question_template , '{QUESTION_ESSENTIALS}') == false) || (strpos( $question_template , '{QUESTION_CLASS}') == false) )
if( preg_match( '/\{QUESTION_ESSENTIALS\}/' , $question_template ) === false || preg_match( '/\{QUESTION_CLASS\}/' , $question_template ) === false )
{
// if {QUESTION_ESSENTIALS} is present in the template but not {QUESTION_CLASS} remove it because you don't want id="" and display="" duplicated.
$question_template = str_replace( '{QUESTION_ESSENTIALS}' , '' , $question_template );
$question_template = str_replace( '{QUESTION_ESSENTIALS}' , '' , $question_template );
$question_template = str_replace( '{QUESTION_CLASS}' , '' , $question_template );

echo '
<!-- NEW QUESTION -->
Expand Down

0 comments on commit 2dca2e3

Please sign in to comment.