aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjwangen <jwangen>2002-10-02 02:35:33 +0000
committerjwangen <jwangen>2002-10-02 02:35:33 +0000
commitc4c389ff735a71c66c902aa115a3ee9240293ac3 (patch)
tree5e43be53ae29fecfc5ac68de2180fcec5b55188a
parent1c834d42efd75524233e1f6517e3a1cb06f6dfde (diff)
downloadphpicalendar-c4c389ff735a71c66c902aa115a3ee9240293ac3.tar.gz
phpicalendar-c4c389ff735a71c66c902aa115a3ee9240293ac3.tar.bz2
phpicalendar-c4c389ff735a71c66c902aa115a3ee9240293ac3.zip
Modified init and day to use $HTTP_GET_VARS instead of $_GET to fix a bug with phpicalendar not working with older versions of PHP properly.
-rw-r--r--day.php4
-rw-r--r--functions/list_icals.php13
-rw-r--r--init.inc.php8
3 files changed, 12 insertions, 13 deletions
diff --git a/day.php b/day.php
index 0a78b94..e312bc2 100644
--- a/day.php
+++ b/day.php
@@ -1,6 +1,6 @@
<?php
-if (isset($_GET["jumpto_day"])) {
- $jumpto_day_time = strtotime($_GET["jumpto_day"]);
+if (isset($HTTP_GET_VARS["jumpto_day"])) {
+ $jumpto_day_time = strtotime($HTTP_GET_VARS["jumpto_day"]);
if ($jumpto_day_time == -1) {
$getdate = date("Ymd");
} else {
diff --git a/functions/list_icals.php b/functions/list_icals.php
index 91e0404..a4025c5 100644
--- a/functions/list_icals.php
+++ b/functions/list_icals.php
@@ -7,25 +7,24 @@ if (isset($getdate)) {
$query="";
}
print "<form>\n<select name=\"action\" class=\"query_style\" onChange=\"window.location=(this.options[this.selectedIndex].value+'$query');\">\n";
-#print "<option value=\"null\">Select a Calendar</option>\n";
// open file
$dir_handle = @opendir($calendar_path) or die("Unable to open $calendar_path");
// build the <option> tags
while ($file = readdir($dir_handle)) {
- if (strstr ($file, ".ics")) {
+ if (substr($file, -4) == ".ics") {
// $cal_filename is the filename of the calendar without .ics
// $cal is a urlencoded version of $cal_filename
// $cal_displayname is $cal_filename with occurrences of "32" replaced with " "
- $cal_filename = substr($file,0,-4);
- $cal_tmp = urlencode($cal_filename);
- $cal_displayname = str_replace("32", " ", $cal_filename);
+ $cal_filename_tmp = substr($file,0,-4);
+ $cal_tmp = urlencode($cal_filename_tmp);
+ $cal_displayname_tmp = str_replace("32", " ", $cal_filename_tmp);
if ($cal_tmp == $cal) {
- print "<option value=\"$current_view.php?cal=$cal_tmp\" selected>$cal_displayname Calendar</option>\n";
+ print "<option value=\"$current_view.php?cal=$cal_tmp\" selected>$cal_displayname_tmp Calendar</option>\n";
} else {
- print "<option value=\"$current_view.php?cal=$cal_tmp\">$cal_displayname Calendar</option>\n";
+ print "<option value=\"$current_view.php?cal=$cal_tmp\">$cal_displayname_tmp Calendar</option>\n";
}
}
diff --git a/init.inc.php b/init.inc.php
index 31f8c1e..f24c6bc 100644
--- a/init.inc.php
+++ b/init.inc.php
@@ -10,7 +10,7 @@ if(phpversion() >= "4.2.0")
include('./config.inc.php');
// subscribe link prefix, doesn't need to be user configureable
-$fullpath = 'webcal://'.$_SERVER['SERVER_NAME'].dirname($_SERVER['PHP_SELF']).'/'.$calendar_path.'/';
+$fullpath = 'webcal://'.$HTTP_SERVER_VARS['SERVER_NAME'].dirname($HTTP_SERVER_VARS['PHP_SELF']).'/'.$calendar_path.'/';
// language support
@@ -28,8 +28,8 @@ if (file_exists($lang_file)) {
// $cal_displayname is $cal_filename with occurrences of "32" replaced with " "
// $cal_filename should always be the filename of the calendar without .ics
-if (isset($_GET["cal"])) {
- $cal_filename = stripslashes(urldecode($_GET["cal"]));
+if (isset($HTTP_GET_VARS["cal"])) {
+ $cal_filename = stripslashes(urldecode($HTTP_GET_VARS["cal"]));
} else {
$cal_filename = $default_cal;
}
@@ -42,7 +42,7 @@ if (!isset($filename)) {
if (!file_exists($filename)) {
$dir_handle = @opendir($calendar_path) or die("Unable to open $calendar_path");
while ($file = readdir($dir_handle)) {
- if (strstr ($file, ".ics")) {
+ if (substr($file, -4) == ".ics") {
$filename = $calendar_path."/".$file;
break;
}

© 2014-2024 Faster IT GmbH | imprint | privacy policy