Skip to content

Commit

Permalink
Some small fixes
Browse files Browse the repository at this point in the history
git-svn-id: file:///Users/Shitiz/Downloads/lssvn/source/phpsurveyor@2851 b72ed6b6-b9f8-46b5-92b4-906544132732
  • Loading branch information
c-schmitz committed May 6, 2007
1 parent f6d20cb commit dbcc9d0
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 20 deletions.
3 changes: 1 addition & 2 deletions admin/importgroup.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@
$handle = fopen($the_full_file_path, "r");
while (!feof($handle))
{
//$buffer = fgets($handle, 1024); //Length parameter is required for PHP versions < 4.2.0
$buffer = fgets($handle, 10240); //To allow for very long survey welcomes (up to 10k)
$bigarray[] = $buffer;
}
Expand Down Expand Up @@ -602,4 +601,4 @@

unlink($the_full_file_path);

?>
?>
3 changes: 1 addition & 2 deletions admin/importlabel.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@
$handle = fopen($the_full_file_path, "r");
while (!feof($handle))
{
//$buffer = fgets($handle, 1024); //Length parameter is required for PHP versions < 4.2.0
$buffer = fgets($handle, 10240); //To allow for very long survey welcomes (up to 10k)
$bigarray[] = $buffer;
}
Expand Down Expand Up @@ -230,4 +229,4 @@



?>
?>
3 changes: 1 addition & 2 deletions admin/importquestion.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@
$handle = fopen($the_full_file_path, "r");
while (!feof($handle))
{
//$buffer = fgets($handle, 1024); //Length parameter is required for PHP versions < 4.2.0
$buffer = fgets($handle, 10240); //To allow for very long survey welcomes (up to 10k)
$bigarray[] = $buffer;
}
Expand Down Expand Up @@ -444,4 +443,4 @@
unlink($the_full_file_path);


?>
?>
5 changes: 2 additions & 3 deletions admin/importsurvey.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,7 @@
while (!feof($handle))
{
//To allow for very long survey lines (up to 10k)
//Note that the Length parameter is required for PHP versions < 4.2.0 - do not remove it!
$buffer = fgets($handle, 10240);
$buffer = fgets($handle, 10240);
$bigarray[] = $buffer;
}
fclose($handle);
Expand Down Expand Up @@ -1045,4 +1044,4 @@ function convertCsvreturn2return($string)
return str_replace('\n', "\n", $string);
}

?>
?>
6 changes: 1 addition & 5 deletions admin/tokens.php
Original file line number Diff line number Diff line change
Expand Up @@ -1044,10 +1044,6 @@
}
else
{
if (_PHPVERSION < "4.2.0")
{
srand((double)microtime()*1000000);
}
$newtokencount = 0;
$tkquery = "SELECT * FROM ".db_table_name("tokens_$surveyid")." WHERE token IS NULL OR token=''";
$tkresult = db_execute_assoc($tkquery) or die ("Mucked up!<br />$tkquery<br />".htmlspecialchars($connect->ErrorMsg()));
Expand Down Expand Up @@ -1630,4 +1626,4 @@ function randomkey($length)
return $key;
}

?>
?>
4 changes: 2 additions & 2 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@

if (!isset($surveyid)) { $surveyid=returnglobal('sid');}
//This next line is for security reasons. It ensures that the $surveyid value is never anything but a number.
if (_PHPVERSION >= '4.2.0') {settype($surveyid, "int");} else {settype($surveyid, "integer");}
$surveyid=sanitize_int($surveyid);

//DEFAULT SETTINGS FOR TEMPLATES
if (!$publicdir) {$publicdir=".";}
Expand Down Expand Up @@ -1621,4 +1621,4 @@ function UpdateFieldArray()
}


?>
?>
4 changes: 2 additions & 2 deletions load.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
require_once(dirname(__FILE__).'/config.php');
if (!isset($surveyid)) {$surveyid=returnglobal('sid');}
//This next line is for security reasons. It ensures that the $surveyid value is never anything but a number.
if (_PHPVERSION >= '4.2.0') {settype($surveyid, "int");} else {settype($surveyid, "integer");}
$surveyid=sanitize_int($surveyid);

if (!isset($thistpl)) {die ("Error!");}
sendcacheheaders();
Expand Down Expand Up @@ -71,4 +71,4 @@
}
doFooter();
exit;
?>
?>
4 changes: 2 additions & 2 deletions qanda.php
Original file line number Diff line number Diff line change
Expand Up @@ -1246,7 +1246,7 @@ function do_ranking($ia)
$choicelist = "\t\t\t\t\t\t<select size='$anscount' name='CHOICES_{$ia[0]}' ";
if (isset($choicewidth)) {$choicelist.=$choicewidth;}
$choicelist .= " id='CHOICES_{$ia[0]}' onclick=\"if (this.options.length>0 && this.selectedIndex<0) {this.options[this.options.length-1].selected=true;}; rankthis_{$ia[0]}(this.options[this.selectedIndex].value, this.options[this.selectedIndex].text)\" class='select'>\n";
if (_PHPVERSION <= "4.2.0")
if (_PHPVERSION = "4.2.0")
{
foreach ($chosen as $chs) {$choose[]=$chs[0];}
foreach ($answers as $ans)
Expand Down Expand Up @@ -2680,4 +2680,4 @@ function retrieve_Answer($code)
}
return $return;
}
?>
?>

0 comments on commit dbcc9d0

Please sign in to comment.