GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Branch master (eb5762)
by Marco
05:09 queued 02:37
created
index.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -14,10 +14,10 @@  discard block
 block discarded – undo
14 14
 require_once('function.php');
15 15
 
16 16
 
17
-if ( $require_auth ) if ( username() == 'unknown' ) exit ("<p>You MUST configure your server to use authentication.</p>");
17
+if ($require_auth) if (username() == 'unknown') exit ("<p>You MUST configure your server to use authentication.</p>");
18 18
 
19 19
 
20
-if ( $imapListActive )
20
+if ($imapListActive)
21 21
 	print ' <p style="text-align: right"><a href="/spamreport" target="_new">SPAM Learn Observer</a></p>';
22 22
 
23 23
 print <<<END
@@ -26,10 +26,10 @@  discard block
 block discarded – undo
26 26
 END;
27 27
 
28 28
 
29
-$option=NULL;
29
+$option = NULL;
30 30
 $desc = array_keys($tables);
31 31
 foreach ($desc as $description) { 
32
-	$disabled = $tables["$description"]['active']==TRUE ? '' : ' disabled';  
32
+	$disabled = $tables["$description"]['active'] == TRUE ? '' : ' disabled';  
33 33
 	$option .= '<option value="'.$description."\"$disabled>$description</option>";
34 34
 	}
35 35
 
Please login to merge, or discard this patch.
list.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -1,26 +1,26 @@
 block discarded – undo
1 1
 <?php
2 2
 require_once('config.php');
3 3
 require_once('function.php');
4
-$typedesc=$_POST['type'];
4
+$typedesc = $_POST['type'];
5 5
 $type = $tables["$typedesc"]['field'];
6 6
 $table = $tables["$typedesc"]['name'];
7 7
 
8 8
 openlog($tag, LOG_PID, $fac);
9 9
 if (empty($_POST['reason'])) die ("<p>Please, specify a reason!</p>");
10
-if (preg_match( '/[^\x20-\x7f]/', $_POST['reason']))
11
-	exit('<p>ERROR: &lt;'.htmlentities($_POST['reason'],ENT_COMPAT | ENT_HTML401, 'ISO-8859-1').'&gt; contains NON ASCII chars.</p>');
10
+if (preg_match('/[^\x20-\x7f]/', $_POST['reason']))
11
+	exit('<p>ERROR: &lt;'.htmlentities($_POST['reason'], ENT_COMPAT | ENT_HTML401, 'ISO-8859-1').'&gt; contains NON ASCII chars.</p>');
12 12
 $user = username();
13 13
 
14 14
 $mysqli = new mysqli($dbhost, $userdb, $pwd, $db, $dbport);
15 15
         if ($mysqli->connect_error) {
16
-            syslog (LOG_EMERG, $user.': Connect Error (' . $mysqli->connect_errno . ') '
16
+            syslog(LOG_EMERG, $user.': Connect Error ('.$mysqli->connect_errno.') '
17 17
                     . $mysqli->connect_error);
18
-            die($user.': Connect Error (' . $mysqli->connect_errno . ') '
18
+            die($user.': Connect Error ('.$mysqli->connect_errno.') '
19 19
                     . $mysqli->connect_error);
20 20
         }
21
-syslog (LOG_INFO, $user.': Successfully connected to ' . $mysqli->host_info );
21
+syslog(LOG_INFO, $user.': Successfully connected to '.$mysqli->host_info);
22 22
 
23
-if (addtolist ($mysqli,username(),$_POST['value'],$type,$table,$_POST['unit'],$_POST['quantity'],$_POST['reason']))
23
+if (addtolist($mysqli, username(), $_POST['value'], $type, $table, $_POST['unit'], $_POST['quantity'], $_POST['reason']))
24 24
  print 'OK '.$_POST["type"].' &lt;'.$_POST['value'].'&gt; first time listed for '.$_POST['quantity'].$_POST['unit'].'.';
25 25
 else
26 26
  print 'List operation ERROR; check log.';
Please login to merge, or discard this patch.
relist.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 require_once('config.php');
3 3
 require_once('function.php');
4
-$typedesc=$_POST['type'];
4
+$typedesc = $_POST['type'];
5 5
         $type = $tables["$typedesc"]['field'];
6 6
         $table = $tables["$typedesc"]['name'];
7 7
 ?>
@@ -9,21 +9,21 @@  discard block
 block discarded – undo
9 9
 <?php
10 10
 openlog($tag, LOG_PID, $fac);
11 11
 if (empty($_POST['reason'])) die ("Specify a reason, please!</td>");
12
-if (preg_match( '/[^\x20-\x7f]/', $_POST['reason']))
13
-        exit('ERROR: &lt;'.htmlentities($_POST['reason'],ENT_COMPAT | ENT_HTML401, 'ISO-8859-1').'&gt; contains NON ASCII chars.</td>');
12
+if (preg_match('/[^\x20-\x7f]/', $_POST['reason']))
13
+        exit('ERROR: &lt;'.htmlentities($_POST['reason'], ENT_COMPAT | ENT_HTML401, 'ISO-8859-1').'&gt; contains NON ASCII chars.</td>');
14 14
 $user = username();
15 15
 
16 16
 $mysqli = new mysqli($dbhost, $userdb, $pwd, $db, $dbport);
17 17
 if ($mysqli->connect_error) {
18
-	syslog (LOG_EMERG, $user.': Connect Error (' . $mysqli->connect_errno . ') '
18
+	syslog(LOG_EMERG, $user.': Connect Error ('.$mysqli->connect_errno.') '
19 19
         	. $mysqli->connect_error);
20
-            exit ($user.': Connect Error (' . $mysqli->connect_errno . ') '
20
+            exit ($user.': Connect Error ('.$mysqli->connect_errno.') '
21 21
                     . $mysqli->connect_error);
22 22
 }
23
-syslog(LOG_INFO, $user.': Successfully connected to ' . $mysqli->host_info) ;
23
+syslog(LOG_INFO, $user.': Successfully connected to '.$mysqli->host_info);
24 24
 
25
-if (isFull($mysqli,$typedesc,$tables)) die("ERROR in relist: ".htmlspecialchars("$typedesc has reached maximum value of ".$tables["$typedesc"]['limit'].' listed items.') );
26
-if (relist ($mysqli,username(),$_POST['value'],$type,$table,$_POST['unit'],$_POST['quantity'],$_POST['reason']))
25
+if (isFull($mysqli, $typedesc, $tables)) die("ERROR in relist: ".htmlspecialchars("$typedesc has reached maximum value of ".$tables["$typedesc"]['limit'].' listed items.'));
26
+if (relist($mysqli, username(), $_POST['value'], $type, $table, $_POST['unit'], $_POST['quantity'], $_POST['reason']))
27 27
  print 'OK '.$_POST["type"].' &lt;'.$_POST['value'].'&gt; relisted for '.$_POST['quantity'].$_POST['unit'];
28 28
 else
29 29
  print 'ERROR in relist; check log';
Please login to merge, or discard this patch.
listForm.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,8 +1,8 @@
 block discarded – undo
1 1
 <?php
2
-if (in_array($user,array_keys(array_filter($adm)))) $extopt = '<option value="MONTH">MONTHS</option><option value="YEAR">YEARS</option>';
2
+if (in_array($user, array_keys(array_filter($adm)))) $extopt = '<option value="MONTH">MONTHS</option><option value="YEAR">YEARS</option>';
3 3
 else $extopt = NULL;
4 4
 ?>
5 5
 <form style="margin:0; text-align: left;" name='ListButton<?php echo $type ?>' enctype="text/plain" method="post" target="_self" action="list.php"  onSubmit="xmlhttpPost('list.php', 'ListButton<?php echo $type ?>', 'Risultato', '<img src=\'/include/pleasewait.gif\'>'); return false;" />
6 6
 
7 7
 		List <?php  echo $typedesc.' &lt;'.$value.'&gt;'; ?> for <input name="type" type="hidden" value="<?php echo $typedesc; ?>" /><input name="value" type="hidden" class="input_text" value="<?php echo $value; ?>" />
8
-		<select name="quantity" class="input_text" size="1"><option value="1">1</option><option value="2">2</option><option value="3">3</option><option value="4">4</option><option value="5">5</option><option value="6">6</option><option value="20">20</option></select><select class="input_text" name="unit" size="1"><option value="DAY">DAYS</option><option value="WEEK">WEEKS</option><?php echo $extopt;?></select>  Reason:<input maxlength="128" name="reason" size="30" type="text" class="input_text" /><input name="List" class="button" id="bwarn" type="submit" value="List"/></form>
8
+		<select name="quantity" class="input_text" size="1"><option value="1">1</option><option value="2">2</option><option value="3">3</option><option value="4">4</option><option value="5">5</option><option value="6">6</option><option value="20">20</option></select><select class="input_text" name="unit" size="1"><option value="DAY">DAYS</option><option value="WEEK">WEEKS</option><?php echo $extopt; ?></select>  Reason:<input maxlength="128" name="reason" size="30" type="text" class="input_text" /><input name="List" class="button" id="bwarn" type="submit" value="List"/></form>
Please login to merge, or discard this patch.
contrib/splunk/listFromSplunk.php 1 patch
Spacing   +31 added lines, -31 removed lines patch added patch discarded remove patch
@@ -10,33 +10,33 @@  discard block
 block discarded – undo
10 10
 #
11 11
 */
12 12
 
13
-$shortopts = "c:";  // Required value
13
+$shortopts = "c:"; // Required value
14 14
 $options = getopt($shortopts);
15
-if ( !isset($options['c']) ) exit ("\n\nUSAGE: ${_SERVER['SCRIPT_NAME']} -c <file.conf>\n\n");
16
-if ( !file_exists(dirname(__FILE__) . '/' . $options['c']) ) exit ("\n\nThe file <".$options['c']."> doesn't exists.\nExiting...\n\n");
15
+if (!isset($options['c'])) exit ("\n\nUSAGE: ${_SERVER['SCRIPT_NAME']} -c <file.conf>\n\n");
16
+if (!file_exists(dirname(__FILE__).'/'.$options['c'])) exit ("\n\nThe file <".$options['c']."> doesn't exists.\nExiting...\n\n");
17 17
 
18 18
 /************** Start of conf ************************/
19 19
 require_once('config.php');
20 20
 
21 21
  /* Syslog */
22
-$tag            .= 'SplunkLister';
22
+$tag .= 'SplunkLister';
23 23
 
24
-$conf = parse_ini_file( dirname(__FILE__) . '/' . $options['c'] );
24
+$conf = parse_ini_file(dirname(__FILE__).'/'.$options['c']);
25 25
 
26 26
  /* Splunk inherited parameters */
27
-$threshold = $conf['threshold'];         /* Threshold value on trigger condition; the same which engage the alert */
28
-$splfile = $argv[10];    		/* Full path of result Splunk file, see at
27
+$threshold = $conf['threshold']; /* Threshold value on trigger condition; the same which engage the alert */
28
+$splfile = $argv[10]; /* Full path of result Splunk file, see at
29 29
                            		   http://docs.splunk.com/Documentation/Splunk/6.2.2/Alert/Configuringscriptedalerts
30 30
                            		   It is 8+2 because of -c <conf> */
31 31
  /* Blacklist name */
32
-$typedesc  = $conf['typedesc'];
32
+$typedesc = $conf['typedesc'];
33 33
 
34 34
  /* How long to list's parameters */
35
-$unit = $conf['unit'];          /* MySQL language ;) */
35
+$unit = $conf['unit']; /* MySQL language ;) */
36 36
 $quantity = $conf['quantity'];
37 37
 
38 38
  /* Syslog */
39
-$tag            .= $conf['tag'];
39
+$tag .= $conf['tag'];
40 40
 
41 41
 /************** End of conf *************************/
42 42
 
@@ -47,8 +47,8 @@  discard block
 block discarded – undo
47 47
 $user = 'Splunk';
48 48
 
49 49
 /* check you select a blocklist */
50
-if ( !$tables["$typedesc"]['bl'] ) {
51
-        syslog(LOG_EMERG,"$user: <$typedesc> is not a blocklist. Are you stupid? Do you want to whitelist a spammer? I refuse to continue.");
50
+if (!$tables["$typedesc"]['bl']) {
51
+        syslog(LOG_EMERG, "$user: <$typedesc> is not a blocklist. Are you stupid? Do you want to whitelist a spammer? I refuse to continue.");
52 52
         exit (254);
53 53
 }
54 54
 
@@ -68,8 +68,8 @@  discard block
 block discarded – undo
68 68
 
69 69
 $tolist = array();
70 70
 
71
-if ( !file_exists($splfile) ) {
72
-        syslog(LOG_ERR,"$user: File <$splfile> not found! Exit.");
71
+if (!file_exists($splfile)) {
72
+        syslog(LOG_ERR, "$user: File <$splfile> not found! Exit.");
73 73
         exit (254);
74 74
 }
75 75
 
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
                 $thisVal = $data[1];
82 82
                 unset($data[1]);
83 83
                 $data = array_values($data);
84
-                if ( !in_array($thisVal,array_keys($tolist))  )
84
+                if (!in_array($thisVal, array_keys($tolist)))
85 85
                         $tolist["$thisVal"] = $data;
86 86
                 else if ($data[3]>$tolist[$thisVal][3])
87 87
                         $tolist["$thisVal"] = $data;
@@ -93,46 +93,46 @@  discard block
 block discarded – undo
93 93
 
94 94
 $mysqli = new mysqli($dbhost, $userdb, $pwd, $db, $dbport);
95 95
 if ($mysqli->connect_error) {
96
-        syslog (LOG_EMERG, $user.': Connect Error (' . $mysqli->connect_errno . ') '
96
+        syslog(LOG_EMERG, $user.': Connect Error ('.$mysqli->connect_errno.') '
97 97
         . $mysqli->connect_error);
98 98
         exit (254);
99 99
 
100 100
 }
101 101
 
102
-syslog(LOG_INFO, $user.': Successfully mysql connected to ' . $mysqli->host_info) ;
102
+syslog(LOG_INFO, $user.': Successfully mysql connected to '.$mysqli->host_info);
103 103
 
104
-foreach ( array_keys($tolist) as $value) {
104
+foreach (array_keys($tolist) as $value) {
105 105
 	$reason = 'On ['.$tolist["$value"][0]."] <$value> sent ".$tolist["$value"][1].' messages to '.$tolist["$value"][2].' recipients.';
106
-        if ( $tolist["$value"][3] >= $threshold ) {
107
-                if ( searchAndList ($mysqli,$user,$tables,$typedesc,$value,$unit,$quantity,$reason) ) {
108
-                        syslog (LOG_INFO, "$user: ".'Listing reason: '.$reason);
106
+        if ($tolist["$value"][3]>=$threshold) {
107
+                if (searchAndList($mysqli, $user, $tables, $typedesc, $value, $unit, $quantity, $reason)) {
108
+                        syslog(LOG_INFO, "$user: ".'Listing reason: '.$reason);
109 109
                         /* Send a email to domain admin if you list an email */
110
-                        if ( ( $tables["$typedesc"]['field'] == 'email' ) OR ( $tables["$typedesc"]['field'] == 'username' ) ) {
110
+                        if (($tables["$typedesc"]['field'] == 'email') OR ($tables["$typedesc"]['field'] == 'username')) {
111 111
 				/* Sometime uid are in the form of <user>@<domain> ... */
112
-				if ( strpos($value, '@') !== FALSE ) {
113
-                                	$domain = array_pop(explode('@',$value,2));
114
-					if ( strpos($domain, '@') === FALSE ) {
115
-                                		$recip = emailToNotify($domainNotify_file,$domain);
112
+				if (strpos($value, '@') !== FALSE) {
113
+                                	$domain = array_pop(explode('@', $value, 2));
114
+					if (strpos($domain, '@') === FALSE) {
115
+                                		$recip = emailToNotify($domainNotify_file, $domain);
116 116
                                 		$subject = sprintf('%s <%s> is now blocked because exceedes limits on outgoing emails',
117 117
 								$tables["$typedesc"]['field'], $value);
118 118
                                 		if (!empty($recip))
119
-                                        		if ( sendEmailWarn($tplfile,'[email protected]',$recip,
120
-								$subject,$value,"$quantity $unit",$reason) )
119
+                                        		if (sendEmailWarn($tplfile, '[email protected]', $recip,
120
+								$subject, $value, "$quantity $unit", $reason))
121 121
                                                 		syslog(LOG_INFO, "$user: \"$recip\" was notified about the \"$value\" abuse.");
122 122
 					}
123
-					else syslog(LOG_ERR,"$user: <$domain> contains the '@' char. Notification cannot be sent.");
123
+					else syslog(LOG_ERR, "$user: <$domain> contains the '@' char. Notification cannot be sent.");
124 124
 				}
125 125
                         }
126 126
                 }
127 127
         }
128 128
 	else {
129 129
 		$reason .= " But it has NOT been listed because it doesn't apply to the trigger condition.";
130
-		syslog (LOG_INFO, "$user: ".$reason);
130
+		syslog(LOG_INFO, "$user: ".$reason);
131 131
 	}
132 132
 }
133 133
 
134 134
 /* Close connection */
135
-syslog (LOG_INFO, "$user: ".'Successfully end of session.');
135
+syslog(LOG_INFO, "$user: ".'Successfully end of session.');
136 136
 $mysqli->close();
137 137
 closelog();
138 138
 
Please login to merge, or discard this patch.
contrib/rbldns/exportdns.php 1 patch
Spacing   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -19,74 +19,74 @@  discard block
 block discarded – undo
19 19
 $user = username();
20 20
 
21 21
 $opts = getopt('f:t:');
22
-if ( isset($opts['f']) ) {
22
+if (isset($opts['f'])) {
23 23
         $filetemplate = $opts['f'];
24
-} else {
24
+}else {
25 25
 	print "\nNo option for '-f' given.\n";
26
-        exit ( usage() );
26
+        exit (usage());
27 27
 }
28 28
 
29
-if ( isset($opts['t']) ) {
29
+if (isset($opts['t'])) {
30 30
         $tablename = $opts['t'];
31
-} else {
31
+}else {
32 32
 	print "\nNo option for '-t' given.\n";
33
-        exit ( usage() );
33
+        exit (usage());
34 34
 }
35 35
 
36
-if ( ($typedescN = array_search( $tablename, array_column($tables, 'name'))) === FALSE ) {
36
+if (($typedescN = array_search($tablename, array_column($tables, 'name'))) === FALSE) {
37 37
         print "\nDB <$tablename> doesn't exist!\n";
38
-        syslog (LOG_EMERG, "$user: DB <$tablename> doesn't exist!");
39
-        exit ( usage() );
38
+        syslog(LOG_EMERG, "$user: DB <$tablename> doesn't exist!");
39
+        exit (usage());
40 40
 }
41 41
 $typedesc = array_keys($tables)[$typedescN];
42 42
 
43
-if (! file_exists($filetemplate) ) {
43
+if (!file_exists($filetemplate)) {
44 44
         print "\nFile <$filetemplate> doesn't exists!\n";
45
-	syslog (LOG_EMERG, "$user: File <$filetemplate> doesn't exist!");
46
-        exit ( usage() );
45
+	syslog(LOG_EMERG, "$user: File <$filetemplate> doesn't exist!");
46
+        exit (usage());
47 47
 }
48 48
 
49
-if (! in_array( $typedesc, array_keys($tables) ) ) {
49
+if (!in_array($typedesc, array_keys($tables))) {
50 50
 	print "\nUnknown list <$typedesc>. Please provide an existent list name.\n";
51
-	exit ( usage() );
51
+	exit (usage());
52 52
 }
53 53
 
54
-if (! $tables["$typedesc"]['active'] ) {
54
+if (!$tables["$typedesc"]['active']) {
55 55
 	print "\nList <$typedesc> is not active. Please provide an active list name.\n";
56
-        exit ( usage() );
56
+        exit (usage());
57 57
 }
58 58
 
59 59
 
60 60
 
61
-$now=new DateTime('NOW');
61
+$now = new DateTime('NOW');
62 62
 $timeunix = $now->format('U');
63 63
 $dateRFC822 = $now->format('r');
64 64
 $year = $now->format('Y');
65
-$rbltype= ($tables["$typedesc"]['bl']) ? 'Blocklist' : 'Whitelist';
65
+$rbltype = ($tables["$typedesc"]['bl']) ? 'Blocklist' : 'Whitelist';
66 66
 
67 67
 
68 68
 $tmpl = file_get_contents($filetemplate);
69
-$arr_tpl_vars = array('{rblname}','{rbltype}','{date822}','{year}','{unixtimestamp}','{rblname64}','{hostname}');
70
-$arr_tpl_data = array($typedesc,$rbltype,$dateRFC822,$year,$timeunix,base64_encode($typedesc),gethostname());
69
+$arr_tpl_vars = array('{rblname}', '{rbltype}', '{date822}', '{year}', '{unixtimestamp}', '{rblname64}', '{hostname}');
70
+$arr_tpl_data = array($typedesc, $rbltype, $dateRFC822, $year, $timeunix, base64_encode($typedesc), gethostname());
71 71
 $headerList = str_replace($arr_tpl_vars, $arr_tpl_data, $tmpl);
72 72
 
73 73
 
74 74
 $mysqli = new mysqli($dbhost, $userdb, $pwd, $db, $dbport);
75 75
 if ($mysqli->connect_error) {
76
-            syslog (LOG_EMERG, $user.': Connect Error (' . $mysqli->connect_errno . ') '
76
+            syslog(LOG_EMERG, $user.': Connect Error ('.$mysqli->connect_errno.') '
77 77
                     . $mysqli->connect_error);
78
-            exit ($user.': Connect Error (' . $mysqli->connect_errno . ') '
78
+            exit ($user.': Connect Error ('.$mysqli->connect_errno.') '
79 79
                     . $mysqli->connect_error);
80 80
 }
81 81
 
82
-syslog(LOG_INFO, $user.': Successfully mysql connected to ' . $mysqli->host_info) ;
82
+syslog(LOG_INFO, $user.': Successfully mysql connected to '.$mysqli->host_info);
83 83
 
84
-$result = searchentry ($mysqli,'ALL',$tables["$typedesc"]);
84
+$result = searchentry($mysqli, 'ALL', $tables["$typedesc"]);
85 85
 if ($result->num_rows) {
86 86
 	$element = array();
87 87
 	while ($riga = $result->fetch_array(MYSQLI_ASSOC)) {
88 88
 		if (isListed($riga)) {
89
-			switch ( $tables["$typedesc"]['field'] ) {
89
+			switch ($tables["$typedesc"]['field']) {
90 90
                                   case 'ip':
91 91
                                         $element[] = long2ip($riga['ip']);
92 92
                                         break;
@@ -104,6 +104,6 @@  discard block
 block discarded – undo
104 104
 $mysqli->close();
105 105
 
106 106
 /* Print to file */
107
-file_put_contents( $tables["$typedesc"]['name'], $headerList . implode("\n",$element) );
107
+file_put_contents($tables["$typedesc"]['name'], $headerList.implode("\n", $element));
108 108
 closelog();
109 109
 ?>
Please login to merge, or discard this patch.
contrib/ipImap/report/result.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -5,11 +5,11 @@
 block discarded – undo
5 5
 
6 6
 
7 7
 print '<p>List of available Reports for '.date('l, d M Y', strtotime($theDate)).'</p><ul>';
8
-foreach($dir as $file)
8
+foreach ($dir as $file)
9 9
 {
10
-        if ( basename($file) != basename(__FILE__) ) {
10
+        if (basename($file) != basename(__FILE__)) {
11 11
 		$modalDiv = 'openModal'.basename($file);
12
-		echo '<li><a href="#'.$modalDiv.'">'.str_replace("-$theDate.html",'',basename($file)).'</a></li>';
12
+		echo '<li><a href="#'.$modalDiv.'">'.str_replace("-$theDate.html", '', basename($file)).'</a></li>';
13 13
 #                echo '<li><pre><a href="'.basename($file).'" title="'.str_replace("-$theDate.html",'',basename($file))." of $theDate".'" onClick="Modalbox.show(this.href, {title: this.title, height: 600}); return false;">'.str_replace("-$theDate.html",'',basename($file)).'</a></pre></li>';
14 14
 		print <<<MODAL
15 15
 <div id="$modalDiv" class="overlay">
Please login to merge, or discard this patch.
contrib/ipImap/report/index.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -31,9 +31,9 @@
 block discarded – undo
31 31
 /* Write Calendar */
32 32
 	  $myCalendar = new tc_calendar("calSpam");
33 33
 	  $myCalendar->setIcon("calendar/images/iconCalendar.gif");
34
-	  $myCalendar->setDate(date('d',$newest), date('m',$newest), date('Y',$newest));
34
+	  $myCalendar->setDate(date('d', $newest), date('m', $newest), date('Y', $newest));
35 35
 	  $myCalendar->setPath("calendar/");
36
-	  $myCalendar->setYearInterval(date('Y',$oldest), date('Y', $newest));
36
+	  $myCalendar->setYearInterval(date('Y', $oldest), date('Y', $newest));
37 37
 	  $myCalendar->dateAllow(date('Y-m-d', $oldest), date('Y-m-d', $newest));
38 38
 	  $myCalendar->setDateFormat('j F Y');
39 39
 	  $myCalendar->startDate(1);
Please login to merge, or discard this patch.
contrib/ipImap/report/calendar/classes/tc_calendar.php 1 patch
Spacing   +195 added lines, -195 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
 
13 13
 require_once('tc_date.php');
14 14
 
15
-class tc_calendar{
15
+class tc_calendar {
16 16
 	public $version = "3.75";
17 17
 	public $check_new_version = false;
18 18
 
@@ -98,12 +98,12 @@  discard block
 block discarded – undo
98 98
 	private $theme = "default";
99 99
 
100 100
 	//calendar constructor
101
-	function __construct($objname, $date_picker = false, $show_input = true, $timezone = ""){
101
+	function __construct($objname, $date_picker = false, $show_input = true, $timezone = "") {
102 102
 		$this->objname = $objname;
103 103
 		//$this->year_display_from_current = 50;
104 104
 		$this->date_picker = $date_picker;
105 105
 
106
-		if($timezone != "") $this->setTimezone($timezone);
106
+		if ($timezone != "") $this->setTimezone($timezone);
107 107
 
108 108
 		//set default year display from current year
109 109
 		$thisyear = date('Y');
@@ -116,36 +116,36 @@  discard block
 block discarded – undo
116 116
 	}
117 117
 
118 118
 	//check for leapyear
119
-	function is_leapyear($year){
119
+	function is_leapyear($year) {
120 120
     	return ($year % 4 == 0) ?
121
-    		!($year % 100 == 0 && $year % 400 <> 0)	: false;
121
+    		!($year % 100 == 0 && $year % 400 <> 0) : false;
122 122
     }
123 123
 
124 124
 	//get the total day of each month in year
125
-    function total_days($month,$year){
125
+    function total_days($month, $year) {
126 126
     	$days = array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
127
-		if($month > 0 && $year > 0){
127
+		if ($month>0 && $year>0) {
128 128
 	    	return ($month == 2 && $this->is_leapYear($year)) ? 29 : $days[$month-1];
129 129
 		}else return 31;
130 130
     }
131 131
 
132 132
 	//Deprecate since v1.6
133
-	function getDayNum($day){
133
+	function getDayNum($day) {
134 134
 		$headers = $this->getDayHeaders();
135 135
 		return isset($headers[$day]) ? $headers[$day] : 0;
136 136
 	}
137 137
 
138 138
 	//get the day headers start from sunday till saturday
139
-	function getDayHeaders(){
139
+	function getDayHeaders() {
140 140
 		$rtn_hdrs = array();
141 141
 		$hdrs = array("0"=>"Su", "1"=>"Mo", "2"=>"Tu", "3"=>"We", "4"=>"Th", "5"=>"Fr", "6"=>"Sa");
142 142
 
143 143
 		$startdate = $this->startDate;
144 144
 
145
-		for($i=0; $i<=6; $i++){
146
-			if($startdate >= sizeof($hdrs)) $startdate = 0;
145
+		for ($i = 0; $i<=6; $i++) {
146
+			if ($startdate>=sizeof($hdrs)) $startdate = 0;
147 147
 			//if(isset($hdrs[(string)$startdate]))
148
-				$rtn_hdrs[] = $hdrs[(string)$startdate];
148
+				$rtn_hdrs[] = $hdrs[(string) $startdate];
149 149
 
150 150
 			$startdate++;
151 151
 		}
@@ -153,11 +153,11 @@  discard block
 block discarded – undo
153 153
 		return $rtn_hdrs;
154 154
 	}
155 155
 
156
-	function setIcon($icon){
156
+	function setIcon($icon) {
157 157
 		$this->icon = $icon;
158 158
 	}
159 159
 
160
-	function setText($txt){
160
+	function setText($txt) {
161 161
 		$this->txt = $txt;
162 162
 	}
163 163
 
@@ -165,12 +165,12 @@  discard block
 block discarded – undo
165 165
 	//input the date format according to php date format
166 166
 	// for example: 'd F y' or 'Y-m-d'
167 167
 	//-----------------------------------------------------------
168
-	function setDateFormat($format){
168
+	function setDateFormat($format) {
169 169
 		$this->date_format = $format;
170 170
 	}
171 171
 
172 172
 	//set default selected date
173
-	function setDate($day, $month, $year){
173
+	function setDate($day, $month, $year) {
174 174
 		//get system timezone before set the date
175 175
 		$this->system_timezone = date_default_timezone_get();
176 176
 		$this->system_timezone_offset = date('Z');
@@ -185,7 +185,7 @@  discard block
 block discarded – undo
185 185
 		$this->year = $year;
186 186
 	}
187 187
 
188
-	function setDateYMD($date){
188
+	function setDateYMD($date) {
189 189
 		list($year, $month, $day) = explode("-", $date, 3);
190 190
 		$this->day = $day;
191 191
 		$this->month = $month;
@@ -193,52 +193,52 @@  discard block
 block discarded – undo
193 193
 	}
194 194
 
195 195
 	//specified location of the calendar_form.php
196
-	function setPath($path){
196
+	function setPath($path) {
197 197
 		$last_char = substr($path, strlen($path)-1, strlen($path));
198
-		if($last_char != "/") $path .= "/";
198
+		if ($last_char != "/") $path .= "/";
199 199
 		$this->path = $path;
200 200
 	}
201 201
 
202
-	function writeScript(){
202
+	function writeScript() {
203 203
 		$this->processScript();
204 204
 	}
205 205
 
206
-	function getScript(){
206
+	function getScript() {
207 207
 		return $this->processScript(true);
208 208
 	}
209 209
 
210
-	function processScript($buffer = false){
210
+	function processScript($buffer = false) {
211 211
 		$str = "";
212 212
 
213 213
 		//check valid default date
214
-		if(!$this->checkDefaultDateValid()){
214
+		if (!$this->checkDefaultDateValid()) {
215 215
 			//unset default date
216 216
 			$this->setDate(00, 00, 0000);
217 217
 		}
218 218
 
219 219
 		//check date set to the timezone
220
-		if($this->year>0 && $this->month>0 && $this->day>0){
220
+		if ($this->year>0 && $this->month>0 && $this->day>0) {
221 221
 			//date has been set
222
-			if($this->timezone != "" && $this->system_timezone != "" && $this->timezone != $this->system_timezone){
222
+			if ($this->timezone != "" && $this->system_timezone != "" && $this->timezone != $this->system_timezone) {
223 223
 				//echo("<br />TZ! ".$this->system_timezone);
224 224
 				//echo("<br />OFFSET: ".$this->system_timezone_offset.",".$this->timezone_offset);
225 225
 				//timezone has been set and different from system timezone
226 226
 				$a_date = $this->year."-".$this->month."-".$this->day." ".$this->system_timezone_h.":".$this->system_timezone_i.":".$this->system_timezone_s;
227 227
 				//echo(", date: $a_date");
228 228
 
229
-				if ((version_compare(PHP_VERSION, '5.3.0') <= 0 && checkdate($this->month, $this->day, $this->year)) || true) {
229
+				if ((version_compare(PHP_VERSION, '5.3.0')<=0 && checkdate($this->month, $this->day, $this->year)) || true) {
230 230
 					//get the timezone difference
231 231
 					$tz_sys_ms = $this->system_timezone_offset;
232 232
 					$tz_new_ms = $this->timezone_offset;
233 233
 
234
-					if($tz_sys_ms>=0 && $tz_new_ms<=0){
234
+					if ($tz_sys_ms>=0 && $tz_new_ms<=0) {
235 235
 						$timezone_diff = 0-($tz_sys_ms+abs($tz_new_ms));
236
-					}elseif($tz_sys_ms<=0 && $tz_new_ms>=0){
236
+					}elseif ($tz_sys_ms<=0 && $tz_new_ms>=0) {
237 237
 						$timezone_diff = abs($tz_sys_ms)+$tz_new_ms;
238
-					}else{
238
+					}else {
239 239
 						$timezone_diff = $tz_sys_ms-$tz_new_ms;
240 240
 					}
241
-					$timezone_diff_hr = $timezone_diff/3600;
241
+					$timezone_diff_hr = $timezone_diff / 3600;
242 242
 					//echo("<br />Diff: ".$timezone_diff_hr);
243 243
 
244 244
 					$a_time = strtotime($a_date);
@@ -255,7 +255,7 @@  discard block
 block discarded – undo
255 255
 					$this->year = date("Y", $n_time);
256 256
 					$this->month = date("m", $n_time);
257 257
 					$this->day = date("d", $n_time);
258
-				}else{
258
+				}else {
259 259
 					$date = new DateTime($a_date, new DateTimeZone($this->system_timezone));
260 260
 					$date->setTimezone(new DateTimeZone($this->timezone));
261 261
 					$this->year = $date->format('Y');
@@ -269,21 +269,21 @@  discard block
 block discarded – undo
269 269
 		$str .= $this->writeHidden();
270 270
 
271 271
 		//check whether it is a date picker
272
-		if($this->date_picker){
272
+		if ($this->date_picker) {
273 273
 			$str .= "<div style=\"position: relative; z-index: ".$this->zindex."; display: inline-block; vertical-align: top;\" id=\"container_".$this->objname."\" onmouseover=\"javascript:focusCalendar('".$this->objname."');\" onmouseout=\"javascript:unFocusCalendar('".$this->objname."', ".$this->zindex.");\">";
274 274
 
275
-			if($this->show_input){
275
+			if ($this->show_input) {
276 276
 				$str .= $this->writeDay();
277 277
 				$str .= $this->writeMonth();
278 278
 				$str .= $this->writeYear();
279
-			}else{
279
+			}else {
280 280
 				$str .= " <a href=\"javascript:toggleCalendar('".$this->objname."', ".$this->auto_hide.", ".$this->auto_hide_time.");\" class=\"tclabel\">";
281 281
 				$str .= $this->writeDateContainer();
282 282
 				$str .= "</a>";
283 283
 			}
284 284
 
285 285
 			$str .= " <a href=\"javascript:toggleCalendar('".$this->objname."', ".$this->auto_hide.", ".$this->auto_hide_time.");\">";
286
-			if(is_file($this->icon)){
286
+			if (is_file($this->icon)) {
287 287
 				$str .= "<img src=\"".$this->icon."\" id=\"tcbtn_".$this->objname."\" name=\"tcbtn_".$this->objname."\" border=\"0\" align=\"absmiddle\" style=\"vertical-align:middle;\" alt=\"".$this->txt."\" title=\"".$this->txt."\" />";
288 288
 			}else $str .= $this->txt;
289 289
 			$str .= "</a>";
@@ -291,123 +291,123 @@  discard block
 block discarded – undo
291 291
 			$str .= $this->writeCalendarContainer();
292 292
 
293 293
 			$str .= "</div>";
294
-		}else{
294
+		}else {
295 295
 			$str .= $this->writeCalendarContainer();
296 296
 		}
297 297
 
298
-		if($buffer){
298
+		if ($buffer) {
299 299
 			return $str;
300
-		}else{
300
+		}else {
301 301
 			echo($str);
302 302
 		}
303 303
 	}
304 304
 
305
-	function writeCalendarContainer(){
305
+	function writeCalendarContainer() {
306 306
 		$params = array();
307 307
 		$params[] = "objname=".$this->objname;
308 308
 
309 309
 		$param = $this->day;
310
-		if($param != "") $params[] = "selected_day=".$param;
310
+		if ($param != "") $params[] = "selected_day=".$param;
311 311
 
312 312
 		$param = $this->month;
313
-		if($param != "") $params[] = "selected_month=".$param;
313
+		if ($param != "") $params[] = "selected_month=".$param;
314 314
 
315 315
 		$param = $this->year;
316
-		if($param != "") $params[] = "selected_year=".$param;
316
+		if ($param != "") $params[] = "selected_year=".$param;
317 317
 
318 318
 		$param = $this->year_start_input;
319
-		if($param != "") $params[] = "year_start=".$param;
319
+		if ($param != "") $params[] = "year_start=".$param;
320 320
 
321 321
 		$param = $this->year_end_input;
322
-		if($param != "") $params[] = "year_end=".$param;
322
+		if ($param != "") $params[] = "year_end=".$param;
323 323
 
324 324
 		$param = ($this->date_picker) ? 1 : 0;
325
-		if($param != "") $params[] = "dp=".$param;
325
+		if ($param != "") $params[] = "dp=".$param;
326 326
 
327 327
 		$param = $this->time_allow1;
328
-		if($param != "") $params[] = "da1=".$param;
328
+		if ($param != "") $params[] = "da1=".$param;
329 329
 
330 330
 		$param = $this->time_allow2;
331
-		if($param != "") $params[] = "da2=".$param;
331
+		if ($param != "") $params[] = "da2=".$param;
332 332
 
333 333
 		$param = $this->show_not_allow;
334
-		if($param != "") $params[] = "sna=".$param;
334
+		if ($param != "") $params[] = "sna=".$param;
335 335
 
336 336
 		$param = $this->auto_submit;
337
-		if($param != "") $params[] = "aut=".$param;
337
+		if ($param != "") $params[] = "aut=".$param;
338 338
 
339 339
 		$param = $this->form_container;
340
-		if($param != "") $params[] = "frm=".$param;
340
+		if ($param != "") $params[] = "frm=".$param;
341 341
 
342 342
 		$param = $this->target_url;
343
-		if($param != "") $params[] = "tar=".$param;
343
+		if ($param != "") $params[] = "tar=".$param;
344 344
 
345 345
 		$param = $this->show_input;
346
-		if($param != "") $params[] = "inp=".$param;
346
+		if ($param != "") $params[] = "inp=".$param;
347 347
 
348 348
 		$param = $this->date_format;
349
-		if($param != "") $params[] = "fmt=".$param;
349
+		if ($param != "") $params[] = "fmt=".$param;
350 350
 
351 351
 		$param = implode(",", $this->dsb_days);
352
-		if($param != "") $params[] = "dis=".$param;
352
+		if ($param != "") $params[] = "dis=".$param;
353 353
 
354 354
 		$param = $this->date_pair1;
355
-		if($param != "") $params[] = "pr1=".$param;
355
+		if ($param != "") $params[] = "pr1=".$param;
356 356
 
357 357
 		$param = $this->date_pair2;
358
-		if($param != "") $params[] = "pr2=".$param;
358
+		if ($param != "") $params[] = "pr2=".$param;
359 359
 
360 360
 		$param = $this->date_pair_value;
361
-		if($param != "") $params[] = "prv=".$param;
361
+		if ($param != "") $params[] = "prv=".$param;
362 362
 
363 363
 		$param = $this->path;
364
-		if($param != "") $params[] = "pth=".$param;
364
+		if ($param != "") $params[] = "pth=".$param;
365 365
 
366 366
 		$param = htmlspecialchars($this->check_json_encode($this->sp_dates), ENT_QUOTES);
367
-		if($param != "") $params[] = "spd=".$param;
367
+		if ($param != "") $params[] = "spd=".$param;
368 368
 
369 369
 		$param = $this->sp_type;
370
-		if($param != "") $params[] = "spt=".$param;
370
+		if ($param != "") $params[] = "spt=".$param;
371 371
 
372 372
 		$param = rawurlencode($this->tc_onchanged);
373
-		if($param != "") $params[] = "och=".$param;
373
+		if ($param != "") $params[] = "och=".$param;
374 374
 
375 375
 		$param = $this->startDate;
376
-		if($param != "") $params[] = "str=".$param;
376
+		if ($param != "") $params[] = "str=".$param;
377 377
 
378 378
 		$param = $this->rtl;
379
-		if($param != "") $params[] = "rtl=".$param;
379
+		if ($param != "") $params[] = "rtl=".$param;
380 380
 
381 381
 		$param = $this->show_week;
382
-		if($param != "") $params[] = "wks=".$param;
382
+		if ($param != "") $params[] = "wks=".$param;
383 383
 
384 384
 		$param = $this->interval;
385
-		if($param != "") $params[] = "int=".$param;
385
+		if ($param != "") $params[] = "int=".$param;
386 386
 
387 387
 		$param = $this->auto_hide;
388
-		if($param != "") $params[] = "hid=".$param;
388
+		if ($param != "") $params[] = "hid=".$param;
389 389
 
390 390
 		$param = $this->auto_hide_time;
391
-		if($param != "") $params[] = "hdt=".$param;
391
+		if ($param != "") $params[] = "hdt=".$param;
392 392
 
393 393
 		$param = $this->timezone;
394
-		if($param != "") $params[] = "tmz=".$param;
394
+		if ($param != "") $params[] = "tmz=".$param;
395 395
 
396 396
 		//$param = $this->system_timezone;
397 397
 		//if($param != "") $params[] = "stz=".$param;
398 398
 
399 399
 		$param = $this->theme;
400
-		if($param != "") $params[] = "thm=".$param;
400
+		if ($param != "") $params[] = "thm=".$param;
401 401
 
402 402
 		$paramStr = (sizeof($params)>0) ? "?".implode("&", $params) : "";
403 403
 
404
-		if($this->date_picker){
404
+		if ($this->date_picker) {
405 405
 			$div_display = "hidden";
406 406
 			$div_position = "absolute";
407 407
 
408 408
 			$line_height = $this->line_height;
409 409
 
410
-			if(is_file($this->icon)){
410
+			if (is_file($this->icon)) {
411 411
 				$img_attribs = getimagesize($this->icon);
412 412
 				$line_height = $img_attribs[1]+2;
413 413
 			}
@@ -415,7 +415,7 @@  discard block
 block discarded – undo
415 415
 			$div_align = "";
416 416
 
417 417
 			//adjust alignment
418
-			switch($this->v_align){
418
+			switch ($this->v_align) {
419 419
 				case "top":
420 420
 					$div_align .= "bottom:".$line_height."px;";
421 421
 					break;
@@ -424,7 +424,7 @@  discard block
 block discarded – undo
424 424
 					$div_align .= "top:".$line_height."px;";
425 425
 			}
426 426
 
427
-			switch($this->h_align){
427
+			switch ($this->h_align) {
428 428
 				case "left":
429 429
 					$div_align .= "left:0px;";
430 430
 					break;
@@ -432,7 +432,7 @@  discard block
 block discarded – undo
432 432
 				default:
433 433
 					$div_align .= "right:0px;";
434 434
 			}
435
-		}else{
435
+		}else {
436 436
 			$div_display = "visible";
437 437
 			$div_position = "relative";
438 438
 			$div_align = "";
@@ -452,15 +452,15 @@  discard block
 block discarded – undo
452 452
 	}
453 453
 
454 454
 	//write the select box of days
455
-	function writeDay(){
455
+	function writeDay() {
456 456
 		$total_days = $this->total_days($this->month, $this->year);
457 457
 
458 458
 		$str = "";
459 459
 		$str .= "<select name=\"".$this->objname."_day\" id=\"".$this->objname."_day\" onChange=\"javascript:tc_setDay('".$this->objname."', this[this.selectedIndex].value);\" class=\"tcday\"".($this->rtl ? " dir=\"rtl\"" : "").">";
460 460
 		$str .= "<option value=\"00\"".($this->rtl ? " dir=\"rtl\"" : "").">Day</option>";
461
-		for($i=1; $i<=$total_days; $i++){
462
-			$selected = ((int)$this->day == $i) ? " selected='selected'" : "";
463
-			$str .= "<option value=\"".str_pad($i, 2 , "0", STR_PAD_LEFT)."\"".$selected.($this->rtl ? " dir=\"rtl\"" : "").">".$i."</option>";
461
+		for ($i = 1; $i<=$total_days; $i++) {
462
+			$selected = ((int) $this->day == $i) ? " selected='selected'" : "";
463
+			$str .= "<option value=\"".str_pad($i, 2, "0", STR_PAD_LEFT)."\"".$selected.($this->rtl ? " dir=\"rtl\"" : "").">".$i."</option>";
464 464
 		}
465 465
 		$str .= "</select> ";
466 466
 
@@ -468,14 +468,14 @@  discard block
 block discarded – undo
468 468
 	}
469 469
 
470 470
 	//write the select box of months
471
-	function writeMonth(){
471
+	function writeMonth() {
472 472
 		$str = "";
473 473
 		$str .= "<select name=\"".$this->objname."_month\" id=\"".$this->objname."_month\" onChange=\"javascript:tc_setMonth('".$this->objname."', this[this.selectedIndex].value);\" class=\"tcmonth\"".($this->rtl ? " dir=\"rtl\"" : "").">";
474 474
 		$str .= "<option value=\"00\"".($this->rtl ? " dir=\"rtl\"" : "").">Month</option>";
475 475
 
476 476
 		$monthnames = $this->getMonthNames();
477
-		for($i=1; $i<=sizeof($monthnames); $i++){
478
-			$selected = ((int)$this->month == $i) ? " selected='selected'" : "";
477
+		for ($i = 1; $i<=sizeof($monthnames); $i++) {
478
+			$selected = ((int) $this->month == $i) ? " selected='selected'" : "";
479 479
 			$str .= "<option value=\"".str_pad($i, 2, "0", STR_PAD_LEFT)."\"".$selected.($this->rtl ? " dir=\"rtl\"" : "").">".$monthnames[$i-1]."</option>";
480 480
 		}
481 481
 		$str .= "</select> ";
@@ -484,7 +484,7 @@  discard block
 block discarded – undo
484 484
 	}
485 485
 
486 486
 	//write the year textbox
487
-	function writeYear(){
487
+	function writeYear() {
488 488
 		$str = "";
489 489
 		//echo("<input type=\"textbox\" name=\"".$this->objname."_year\" id=\"".$this->objname."_year\" value=\"$this->year\" maxlength=4 size=5 onBlur=\"javascript:tc_setYear('".$this->objname."', this.value, '$this->path');\" onKeyPress=\"javascript:if(yearEnter(event)){ tc_setYear('".$this->objname."', this.value, '$this->path'); return false; }\"> ");
490 490
 		$str .= "<select name=\"".$this->objname."_year\" id=\"".$this->objname."_year\" onChange=\"javascript:tc_setYear('".$this->objname."', this[this.selectedIndex].value);\" class=\"tcyear\"".($this->rtl ? " dir=\"rtl\"" : "").">";
@@ -494,21 +494,21 @@  discard block
 block discarded – undo
494 494
 		$year_end = $this->year_end;
495 495
 
496 496
 		//check year to be selected in case of time_allow is set
497
-		if(!$this->show_not_allow && ($this->time_allow1 || $this->time_allow2)){
498
-			if($this->time_allow1 && $this->time_allow2){
497
+		if (!$this->show_not_allow && ($this->time_allow1 || $this->time_allow2)) {
498
+			if ($this->time_allow1 && $this->time_allow2) {
499 499
 				$year_start = $this->mydate->getDate("Y", $this->time_allow1);
500 500
 				$year_end = $this->mydate->getDate("Y", $this->time_allow2);
501
-			}elseif($this->time_allow1){
501
+			}elseif ($this->time_allow1) {
502 502
 				//only date 1 specified
503 503
 				$year_start = $this->mydate->getDate("Y", $this->time_allow1);
504
-			}elseif($this->time_allow2){
504
+			}elseif ($this->time_allow2) {
505 505
 				//only date 2 specified
506 506
 				$year_end = $this->mydate->getDate("Y", $this->time_allow2);
507 507
 			}
508 508
 		}
509 509
 
510
-		for($i=$year_end; $i>=$year_start; $i--){
511
-			$selected = ((int)$this->year == $i) ? " selected='selected'" : "";
510
+		for ($i = $year_end; $i>=$year_start; $i--) {
511
+			$selected = ((int) $this->year == $i) ? " selected='selected'" : "";
512 512
 			$str .= "<option value=\"".$i."\"".$selected.($this->rtl ? " dir=\"rtl\"" : "").">".$i."</option>";
513 513
 		}
514 514
 		$str .= "</select> ";
@@ -517,14 +517,14 @@  discard block
 block discarded – undo
517 517
 	}
518 518
 
519 519
 	function eHidden($suffix, $value) {
520
-		if(trim($value) != ""){
521
-			if($suffix) $suffix = "_".$suffix;
520
+		if (trim($value) != "") {
521
+			if ($suffix) $suffix = "_".$suffix;
522 522
 			return "<input type=\"hidden\" name=\"".$this->objname.$suffix."\" id=\"".$this->objname.$suffix."\" value=\"".$value."\" />";
523 523
 		}
524 524
 	}
525 525
 
526 526
 	//write hidden components
527
-	function writeHidden(){
527
+	function writeHidden() {
528 528
 		$str = "";
529 529
 
530 530
 		$str .= $this->eHidden('', $this->getDate());
@@ -574,8 +574,8 @@  discard block
 block discarded – undo
574 574
 	// Deprecated since version 2.9
575 575
 	// Auto sizing is applied
576 576
 	//---------------------------
577
-	function setWidth($width){
578
-		if($width) $this->width = $width;
577
+	function setWidth($width) {
578
+		if ($width) $this->width = $width;
579 579
 	}
580 580
 
581 581
 	//set height of calendar
@@ -583,27 +583,27 @@  discard block
 block discarded – undo
583 583
 	// Deprecated since version 2.9
584 584
 	// Auto sizing is applied
585 585
 	//---------------------------
586
-	function setHeight($height){
587
-		if($height) $this->height = $height;
586
+	function setHeight($height) {
587
+		if ($height) $this->height = $height;
588 588
 	}
589 589
 
590
-	function setYearInterval($start, $end){
590
+	function setYearInterval($start, $end) {
591 591
 		$this->year_start_input = $start;
592 592
 		$this->year_end_input = $end;
593 593
 
594
-		if(!$start) $start = $this->year_start;
595
-		if(!$end) $end = $this->year_end;
594
+		if (!$start) $start = $this->year_start;
595
+		if (!$end) $end = $this->year_end;
596 596
 
597
-		if($start < $end){
597
+		if ($start<$end) {
598 598
 			$this->year_start = $start;
599 599
 			$this->year_end = $end;
600
-		}else{
600
+		}else {
601 601
 			$this->year_start = $end;
602 602
 			$this->year_end = $start;
603 603
 		}
604 604
 	}
605 605
 
606
-	function getMonthNames(){
606
+	function getMonthNames() {
607 607
 		return array("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December");
608 608
 	}
609 609
 
@@ -611,24 +611,24 @@  discard block
 block discarded – undo
611 611
 	// Deprecated since version 3.61
612 612
 	// override by startDate()
613 613
 	//-------------------------------
614
-	function startMonday($flag){
614
+	function startMonday($flag) {
615 615
 		//$this->startMonday = $flag;
616 616
 
617 617
 		//change it so that it will not cause an error after version 3.61
618
-		if($flag) $this->startDate = 1;
618
+		if ($flag) $this->startDate = 1;
619 619
 	}
620 620
 
621
-	function startDate($num){
622
-		if(is_numeric($num) && $num >= 0 && $num <= 6)
621
+	function startDate($num) {
622
+		if (is_numeric($num) && $num>=0 && $num<=6)
623 623
 			$this->startDate = $num;
624 624
 	}
625 625
 
626
-	function dateAllow($from = "", $to = "", $show_not_allow = true){
626
+	function dateAllow($from = "", $to = "", $show_not_allow = true) {
627 627
 		$time_from = $this->mydate->validDate($from) ? $from : null;
628 628
 		$time_to = $this->mydate->validDate($to) ? $to : null;
629 629
 
630 630
 		// sanity check, ensure time_from earlier than time_to
631
-		if($time_from != null && $time_to != null && $this->mydate->dateAfter($time_to, $time_from, true)){
631
+		if ($time_from != null && $time_to != null && $this->mydate->dateAfter($time_to, $time_from, true)) {
632 632
 			$tmp = $time_from;
633 633
 			$time_from = $time_to;
634 634
 			$time_to = $tmp;
@@ -637,40 +637,40 @@  discard block
 block discarded – undo
637 637
 		if ($time_from != null) {
638 638
 			$this->time_allow1 = $time_from;
639 639
 			$y = $this->mydate->getDate('Y', $time_from);
640
-			if($this->year_start && $y > $this->year_start) $this->year_start = $y;
640
+			if ($this->year_start && $y>$this->year_start) $this->year_start = $y;
641 641
 
642 642
 			//setup year end from year start
643
-			if($time_to == null && !$this->year_end) $this->year_end = $this->year_start + $this->year_display_from_current;
643
+			if ($time_to == null && !$this->year_end) $this->year_end = $this->year_start+$this->year_display_from_current;
644 644
 		}
645 645
 
646 646
 		if ($time_to>0) {
647 647
 			$this->time_allow2 = $time_to;
648 648
 			$y = $this->mydate->getDate('Y', $time_to);
649
-			if($this->year_end && $y < $this->year_end) $this->year_end = $y;
649
+			if ($this->year_end && $y<$this->year_end) $this->year_end = $y;
650 650
 
651 651
 			//setup year start from year end
652
-			if($time_from == null && !$this->year_start) $this->year_start = $this->year_end - $this->year_display_from_current;
652
+			if ($time_from == null && !$this->year_start) $this->year_start = $this->year_end-$this->year_display_from_current;
653 653
 		}
654 654
 
655 655
 		$this->show_not_allow = $show_not_allow;
656 656
 	}
657 657
 
658
-	function autoSubmit($auto, $form_name, $target = ""){
658
+	function autoSubmit($auto, $form_name, $target = "") {
659 659
 		$this->auto_submit = $auto;
660 660
 		$this->form_container = $form_name;
661 661
 		$this->target_url = $target;
662 662
 	}
663 663
 
664
-	function getDate(){
664
+	function getDate() {
665 665
 		return str_pad($this->year, 4, "0", STR_PAD_LEFT)."-".str_pad($this->month, 2, "0", STR_PAD_LEFT)."-".str_pad($this->day, 2, "0", STR_PAD_LEFT);
666 666
 	}
667 667
 
668
-	function showInput($flag){
668
+	function showInput($flag) {
669 669
 		$this->show_input = $flag;
670 670
 	}
671 671
 
672
-	function writeDateContainer(){
673
-		if($this->day && $this->month && $this->year){
672
+	function writeDateContainer() {
673
+		if ($this->day && $this->month && $this->year) {
674 674
 			$dd = $this->mydate->getDate($this->date_format, $this->year."-".$this->month."-".$this->day);
675 675
 		}else $dd = "Select Date";
676 676
 
@@ -681,47 +681,47 @@  discard block
 block discarded – undo
681 681
 	// This function disable day column as specified value
682 682
 	// day values : Sun, Mon, Tue, Wed, Thu, Fri, Sat
683 683
 	//------------------------------------------------------
684
-	function disabledDay($day){
684
+	function disabledDay($day) {
685 685
 		$day = strtolower($day); //make it not case-sensitive
686
-		if(in_array($day, $this->dsb_days) === false)
686
+		if (in_array($day, $this->dsb_days) === false)
687 687
 			$this->dsb_days[] = $day;
688 688
 	}
689 689
 
690
-	function setAlignment($h_align, $v_align){
690
+	function setAlignment($h_align, $v_align) {
691 691
 		$this->h_align = $h_align;
692 692
 		$this->v_align = $v_align;
693 693
 	}
694 694
 
695
-	function setDatePair($calendar_name1, $calendar_name2, $pair_value = "0000-00-00 00:00:00"){
696
-		if($calendar_name1 != $this->objname){
695
+	function setDatePair($calendar_name1, $calendar_name2, $pair_value = "0000-00-00 00:00:00") {
696
+		if ($calendar_name1 != $this->objname) {
697 697
 			$this->date_pair1 = $calendar_name1;
698
-			if($pair_value != "0000-00-00 00:00:00")
698
+			if ($pair_value != "0000-00-00 00:00:00")
699 699
 				$this->date_pair_value = $pair_value;
700
-		}elseif($calendar_name2 != $this->objname){
700
+		}elseif ($calendar_name2 != $this->objname) {
701 701
 			$this->date_pair2 = $calendar_name2;
702
-			if($pair_value != "0000-00-00 00:00:00")
702
+			if ($pair_value != "0000-00-00 00:00:00")
703 703
 				$this->date_pair_value = $pair_value;
704 704
 		}
705 705
 	}
706 706
 
707
-	function setSpecificDate($dates, $type=0, $recursive=""){
708
-		if(is_array($dates)){
707
+	function setSpecificDate($dates, $type = 0, $recursive = "") {
708
+		if (is_array($dates)) {
709 709
 			$recursive = strtolower($recursive);
710 710
 
711 711
 			//change specific date to time
712
-			foreach($dates as $sp_date){
713
-				if($this->mydate->validDate($sp_date)){
714
-					switch($recursive){
712
+			foreach ($dates as $sp_date) {
713
+				if ($this->mydate->validDate($sp_date)) {
714
+					switch ($recursive) {
715 715
 						case "month": //add to monthly
716
-							if(!in_array($sp_date, $this->sp_dates[1]))
716
+							if (!in_array($sp_date, $this->sp_dates[1]))
717 717
 								$this->sp_dates[1][] = $sp_date;
718 718
 							break;
719 719
 						case "year": //add to yearly
720
-							if(!in_array($sp_date, $this->sp_dates[2]))
720
+							if (!in_array($sp_date, $this->sp_dates[2]))
721 721
 								$this->sp_dates[2][] = $sp_date;
722 722
 							break;
723 723
 						default: //add to no recursive
724
-							if(!in_array($sp_date, $this->sp_dates[0]))
724
+							if (!in_array($sp_date, $this->sp_dates[0]))
725 725
 								$this->sp_dates[0][] = $sp_date;
726 726
 					}
727 727
 				}
@@ -762,7 +762,7 @@  discard block
 block discarded – undo
762 762
 	}
763 763
 	*/
764 764
 
765
-	function checkDefaultDateValid($reset = true){
765
+	function checkDefaultDateValid($reset = true) {
766 766
 		$date_str = $this->year."-".str_pad($this->month, 2, "0", STR_PAD_LEFT)."-".str_pad($this->day, 2, "0", STR_PAD_LEFT);
767 767
 		//$default_datetime = $this->mydate->getTimestamp($date_str);
768 768
 /*
@@ -776,72 +776,72 @@  discard block
 block discarded – undo
776 776
 		$end_interval = $this->year_end."-12-31";
777 777
 
778 778
 		//check if set date is before start_interval
779
-		if($this->mydate->dateBefore($start_interval, $date_str)){
779
+		if ($this->mydate->dateBefore($start_interval, $date_str)) {
780 780
 			return false;
781 781
 		}
782 782
 
783 783
 		//check if set date is after end_interval
784
-		if($this->mydate->dateAfter($end_interval, $date_str)){
784
+		if ($this->mydate->dateAfter($end_interval, $date_str)) {
785 785
 			return false;
786 786
 		}
787 787
 
788 788
 		//check with allow date
789
-		if($this->time_allow1 && $this->time_allow2){
790
-			if($this->mydate->dateBefore($this->time_allow1, $date_str, false) || $this->mydate->dateAfter($this->time_allow2, $date_str, false)){
789
+		if ($this->time_allow1 && $this->time_allow2) {
790
+			if ($this->mydate->dateBefore($this->time_allow1, $date_str, false) || $this->mydate->dateAfter($this->time_allow2, $date_str, false)) {
791 791
 				return false;
792 792
 			}
793
-		}elseif($this->time_allow1){
794
-			if($this->mydate->dateBefore($this->time_allow1, $date_str, false)) return false;
795
-		}elseif($this->time_allow2){
796
-			if($this->mydate->dateAfter($this->time_allow2, $date_str, false)) return false;
793
+		}elseif ($this->time_allow1) {
794
+			if ($this->mydate->dateBefore($this->time_allow1, $date_str, false)) return false;
795
+		}elseif ($this->time_allow2) {
796
+			if ($this->mydate->dateAfter($this->time_allow2, $date_str, false)) return false;
797 797
 		}
798 798
 
799 799
 		//check with specific date
800
-		if(is_array($this->sp_dates) && sizeof($this->sp_dates) > 0){
800
+		if (is_array($this->sp_dates) && sizeof($this->sp_dates)>0) {
801 801
 			//check if it is current date
802 802
 			$sp_found = false;
803 803
 
804
-			if(isset($this->sp_dates[2])){
805
-				foreach($this->sp_dates[2] as $sp_time){
804
+			if (isset($this->sp_dates[2])) {
805
+				foreach ($this->sp_dates[2] as $sp_time) {
806 806
 					$this_md = $this->mydate->getDate("md", $date_str);
807 807
 					$sp_time_md = $this->mydate->getDate("md", $sp_time);
808
-					if($sp_time_md == $this_md){
808
+					if ($sp_time_md == $this_md) {
809 809
 						$sp_found = true;
810 810
 						break;
811 811
 					}
812 812
 				}
813 813
 			}
814 814
 
815
-			if(isset($this->sp_dates[1]) && !$sp_found){
816
-				foreach($this->sp_dates[1] as $sp_time){
815
+			if (isset($this->sp_dates[1]) && !$sp_found) {
816
+				foreach ($this->sp_dates[1] as $sp_time) {
817 817
 					$sp_time_d = $this->mydate->getDate("d", $sp_time);
818
-					if($sp_time_d == $this->day){
818
+					if ($sp_time_d == $this->day) {
819 819
 						$sp_found = true;
820 820
 						break;
821 821
 					}
822 822
 				}
823 823
 			}
824 824
 
825
-			if(isset($this->sp_dates[0]) && !$sp_found){
825
+			if (isset($this->sp_dates[0]) && !$sp_found) {
826 826
 				$sp_found = in_array($date_str, $this->sp_dates[0]);
827 827
 			}
828 828
 
829
-			switch($this->sp_type){
829
+			switch ($this->sp_type) {
830 830
 				case 0:
831 831
 				default:
832 832
 					//disabled specific and enabled others
833
-					if($sp_found) return false;
833
+					if ($sp_found) return false;
834 834
 					break;
835 835
 				case 1:
836 836
 					//enabled specific and disabled others
837
-					if(!$sp_found) return false;
837
+					if (!$sp_found) return false;
838 838
 					break;
839 839
 			}
840 840
 		}
841 841
 
842
-		if(is_array($this->dsb_days) && sizeof($this->dsb_days) > 0){
842
+		if (is_array($this->dsb_days) && sizeof($this->dsb_days)>0) {
843 843
 			$day_txt = $this->mydate->getDate("D", $date_str);
844
-			if(in_array(strtolower($day_txt), $this->dsb_days) !== false){
844
+			if (in_array(strtolower($day_txt), $this->dsb_days) !== false) {
845 845
 				return false;
846 846
 			}
847 847
 		}
@@ -849,16 +849,16 @@  discard block
 block discarded – undo
849 849
 		return true;
850 850
 	}
851 851
 
852
-	function check_json_encode($obj){
852
+	function check_json_encode($obj) {
853 853
 		//try customize to get it work, should replace with better solution in the future
854
-		if(is_array($obj)){
855
-			if(function_exists("json_encode") && false){
854
+		if (is_array($obj)) {
855
+			if (function_exists("json_encode") && false) {
856 856
 				return json_encode($obj);
857
-			}else{
857
+			}else {
858 858
 				//only array is assumed for now
859 859
 				$return_arr = array();
860
-				foreach($obj as $arr){
861
-					if(is_array($arr) && sizeof($arr)>0)
860
+				foreach ($obj as $arr) {
861
+					if (is_array($arr) && sizeof($arr)>0)
862 862
 						$return_arr[] = "[\"".implode("\",\"", $arr)."\"]";
863 863
 					else $return_arr[] = "[]";
864 864
 				}
@@ -870,17 +870,17 @@  discard block
 block discarded – undo
870 870
 	function &check_json_decode($str){
871 871
 		//should replace with better solution in the future
872 872
 
873
-		if(function_exists("json_decode") && false){
873
+		if (function_exists("json_decode") && false) {
874 874
 			return json_decode($str);
875
-		}else{
875
+		}else {
876 876
 			//only array is assume for now
877 877
 			$str = stripslashes(rawurldecode($str));
878 878
 			$str = trim($str);
879 879
 
880
-			if($str && strlen($str) > 2){
880
+			if ($str && strlen($str)>2) {
881 881
 				$str = substr($str, 1, strlen($str)-2);
882 882
 
883
-				if($str && strlen($str) > 2){
883
+				if ($str && strlen($str)>2) {
884 884
 					$str = substr($str, 1, strlen($str)-2);
885 885
 
886 886
 					$return_arr = array();
@@ -888,15 +888,15 @@  discard block
 block discarded – undo
888 888
 					$offset = 0;
889 889
 
890 890
 					$arr = explode("],[", $str);
891
-					for($i=0; $i<sizeof($arr); $i++){
891
+					for ($i = 0; $i<sizeof($arr); $i++) {
892 892
 						$this_v = $arr[$i];
893
-						if($this_v == "")
893
+						if ($this_v == "")
894 894
 							$return_arr[] = array();
895
-						else{
895
+						else {
896 896
 							$this_arr = explode(",", $this_v);
897 897
 
898
-							for($j=0; $j<sizeof($this_arr); $j++){
899
-								if(substr($this_arr[$j], 0, 1)=="\"" && substr($this_arr[$j], strlen($this_arr[$j])-1, 1)=="\""){
898
+							for ($j = 0; $j<sizeof($this_arr); $j++) {
899
+								if (substr($this_arr[$j], 0, 1) == "\"" && substr($this_arr[$j], strlen($this_arr[$j])-1, 1) == "\"") {
900 900
 									$this_arr[$j] = substr($this_arr[$j], 1, strlen($this_arr[$j])-2);
901 901
 								}
902 902
 							}
@@ -910,17 +910,17 @@  discard block
 block discarded – undo
910 910
 		}
911 911
 	}
912 912
 
913
-	function setOnChange($value){
913
+	function setOnChange($value) {
914 914
 		$this->tc_onchanged = $value;
915 915
 	}
916 916
 
917
-	function showWeeks($flag){
917
+	function showWeeks($flag) {
918 918
 		$this->show_week = $flag;
919 919
 	}
920 920
 
921
-	function setAutoHide($auto, $time = ""){
921
+	function setAutoHide($auto, $time = "") {
922 922
 		$this->auto_hide = ($auto) ? 1 : 0;
923
-		if($time != "" && $time >= 0){
923
+		if ($time != "" && $time>=0) {
924 924
 			$this->auto_hide_time = $time;
925 925
 		}
926 926
 	}
@@ -928,66 +928,66 @@  discard block
 block discarded – undo
928 928
 	//*****************
929 929
 	// Validate the today date of calendar
930 930
 	//*****************
931
-	function validTodayDate(){
931
+	function validTodayDate() {
932 932
 		$today = $this->mydate->getDate();
933 933
 
934 934
 		//check if today is year 2038 and later
935
-		if(!$this->mydate->compatible && $this->mydate->getDate("Y") >= 2038){
935
+		if (!$this->mydate->compatible && $this->mydate->getDate("Y")>=2038) {
936 936
 			return false;
937 937
 		}
938 938
 
939 939
 		//check if today is in range of date allow
940
-		if($this->time_allow1 != ""){
940
+		if ($this->time_allow1 != "") {
941 941
 			//check valid if today is after date_allow1
942
-			if($this->mydate->validDate($this->time_allow1) && !$this->mydate->dateAfter($this->time_allow1, $today))
942
+			if ($this->mydate->validDate($this->time_allow1) && !$this->mydate->dateAfter($this->time_allow1, $today))
943 943
 				return false;
944 944
 		}
945 945
 
946
-		if($this->time_allow2 > 0){
946
+		if ($this->time_allow2>0) {
947 947
 			//check valid if today is before date_allow2
948
-			if($this->mydate->validDate($this->time_allow2) && !$this->mydate->dateBefore($this->time_allow2, $today))
948
+			if ($this->mydate->validDate($this->time_allow2) && !$this->mydate->dateBefore($this->time_allow2, $today))
949 949
 				return false;
950 950
 		}
951 951
 		return true;
952 952
 	}
953 953
 
954 954
 	//Tooltips
955
-	function setToolTips($dates, $tooltip="", $recursive=""){
955
+	function setToolTips($dates, $tooltip = "", $recursive = "") {
956 956
 
957
-		if(is_array($dates)){
957
+		if (is_array($dates)) {
958 958
 			$recursive = strtolower($recursive);
959 959
 
960 960
 			//change specific date to time
961
-			foreach($dates as $tt_date){
961
+			foreach ($dates as $tt_date) {
962 962
 				$tt_time = $tt_date;
963 963
 //				if($tt_time > 0){
964
-				switch($recursive){
964
+				switch ($recursive) {
965 965
 					case "year": //add to yearly
966
-						if(!in_array($tt_time, $this->tt_dates[2])){
966
+						if (!in_array($tt_time, $this->tt_dates[2])) {
967 967
 							$this->tt_dates[2][] = $tt_time;
968 968
 							$this->tt_tooltips[2][] = $tooltip;
969 969
 						}
970
-						else{
970
+						else {
971 971
 							$tt_key = array_search($tt_time, $this->tt_dates[2]);
972 972
 							$this->tt_tooltips[2][$tt_key] = $this->tt_tooltips[2][$tt_key]."\n".$tooltip;
973 973
 						}
974 974
 						break;
975 975
 					case "month": //add to monthly
976
-						if(!in_array($tt_time, $this->tt_dates[1])){
976
+						if (!in_array($tt_time, $this->tt_dates[1])) {
977 977
 							$this->tt_dates[1][] = $tt_time;
978 978
 							$this->tt_tooltips[1][] = $tooltip;
979 979
 						}
980
-						else{
980
+						else {
981 981
 							$tt_key = array_search($tt_time, $this->tt_dates[1]);
982 982
 							$this->tt_tooltips[1][$tt_key] = $this->tt_tooltips[1][$tt_key]."\n".$tooltip;
983 983
 						}
984 984
 						break;
985 985
 					default: //add to no recursive
986
-						if(!in_array($tt_time, $this->tt_dates[0])){
986
+						if (!in_array($tt_time, $this->tt_dates[0])) {
987 987
 							$this->tt_dates[0][] = $tt_time;
988 988
 							$this->tt_tooltips[0][] = $tooltip;
989 989
 						}
990
-						else{
990
+						else {
991 991
 							$tt_key = array_search($tt_time, $this->tt_dates[0]);
992 992
 							$this->tt_tooltips[0][$tt_key] = $this->tt_tooltips[0][$tt_key]."\n".$tooltip;
993 993
 						}
@@ -997,23 +997,23 @@  discard block
 block discarded – undo
997 997
 		}
998 998
 	}
999 999
 
1000
-	function setTimezone($tz){
1000
+	function setTimezone($tz) {
1001 1001
 		$this->timezone = $tz;
1002 1002
 		@date_default_timezone_set($tz);
1003 1003
 		$this->timezone_offset = date('Z');
1004 1004
 		//echo("new timezone: ".$this->timezone);
1005 1005
 	}
1006 1006
 
1007
-	function setTheme($theme){
1007
+	function setTheme($theme) {
1008 1008
 		$this->theme = $theme;
1009 1009
 	}
1010 1010
 
1011
-	function getThemes(){
1011
+	function getThemes() {
1012 1012
 		$themes = array();
1013 1013
 		$themesDirectory = dir('./css/');
1014
-		while($thname = $themesDirectory->read())
1014
+		while ($thname = $themesDirectory->read())
1015 1015
 		{
1016
-			if(is_dir('./css/'.$thname) && file_exists('./css/'.$thname.'/calendar.css') && !preg_match("/^[\.]/", $thname))
1016
+			if (is_dir('./css/'.$thname) && file_exists('./css/'.$thname.'/calendar.css') && !preg_match("/^[\.]/", $thname))
1017 1017
 			{
1018 1018
 				$themes[$thname] = "./css/".$thname."/calendar.css";
1019 1019
 			};
@@ -1023,7 +1023,7 @@  discard block
 block discarded – undo
1023 1023
 		return $themes;
1024 1024
 	}
1025 1025
 
1026
-	function getThemePath($theme){
1026
+	function getThemePath($theme) {
1027 1027
 		$all_themes = $this->getThemes();
1028 1028
 		return isset($all_themes[$theme]) ? $all_themes[$theme] : "";
1029 1029
 	}
Please login to merge, or discard this patch.