Completed
Push — 1.10.x ( 320abc...039d05 )
by José
151:51 queued 109:10
created
main/inc/lib/pdf.lib.php 1 patch
Indentation   -1 removed lines patch added patch discarded remove patch
@@ -16,7 +16,6 @@
 block discarded – undo
16 16
  * @author Patrick Cool
17 17
  * @author René Haentjens, added CSV file import (October 2004)
18 18
  * @package chamilo.link
19
-
20 19
  */
21 20
 
22 21
 // Including libraries
Please login to merge, or discard this patch.
main/inc/lib/pear/Text/Diff.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -227,7 +227,7 @@  discard block
 block discarded – undo
227 227
     function _getTempDir()
228 228
     {
229 229
         $tmp_locations = array('/tmp', '/var/tmp', 'c:\WUTemp', 'c:\temp',
230
-                               'c:\windows\temp', 'c:\winnt\temp');
230
+                                'c:\windows\temp', 'c:\winnt\temp');
231 231
 
232 232
         /* Try PHP's upload_tmp_dir directive. */
233 233
         $tmp = ini_get('upload_tmp_dir');
@@ -309,7 +309,7 @@  discard block
 block discarded – undo
309 309
      *                                  of elements as $to_lines.
310 310
      */
311 311
     function Text_MappedDiff($from_lines, $to_lines,
312
-                             $mapped_from_lines, $mapped_to_lines)
312
+                                $mapped_from_lines, $mapped_to_lines)
313 313
     {
314 314
         assert(count($from_lines) == count($mapped_from_lines));
315 315
         assert(count($to_lines) == count($mapped_to_lines));
Please login to merge, or discard this patch.
main/inc/lib/pear/HTML/QuickForm/Rule/Date.php 1 patch
Indentation   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -6,15 +6,15 @@
 block discarded – undo
6 6
  */
7 7
 class Html_Quickform_Rule_Date extends HTML_QuickForm_Rule
8 8
 {
9
-	/**
10
-	 * Function to check a date
11
-	 * @see HTML_QuickForm_Rule
12
-	 * @param array $date An array with keys F (month), d (day) and Y (year)
13
-	 * @return boolean True if date is valid
14
-	 */
15
-	function validate($date, $options)
16
-	{
17
-		$compareDate = create_function('$a', 'return checkdate($a[\'M\'],$a[\'d\'],$a[\'Y\']);');
9
+    /**
10
+     * Function to check a date
11
+     * @see HTML_QuickForm_Rule
12
+     * @param array $date An array with keys F (month), d (day) and Y (year)
13
+     * @return boolean True if date is valid
14
+     */
15
+    function validate($date, $options)
16
+    {
17
+        $compareDate = create_function('$a', 'return checkdate($a[\'M\'],$a[\'d\'],$a[\'Y\']);');
18 18
         return $compareDate($date);
19
-	}
19
+    }
20 20
 }
Please login to merge, or discard this patch.
main/inc/lib/getid3/module.audio-video.flv.php 1 patch
Indentation   +401 added lines, -401 removed lines patch added patch discarded remove patch
@@ -56,522 +56,522 @@
 block discarded – undo
56 56
     const VIDEO_VP6    = 4;
57 57
 
58 58
 
59
-	public function Analyze()
60
-	{
61
-	    $info = &$this->getid3->info;
62
-
63
-	    $info['flv'] = array ();
64
-	    $info_flv = &$info['flv'];
65
-
66
-		fseek($this->getid3->fp, $info['avdataoffset'], SEEK_SET);
67
-
68
-		$flv_data_length = $info['avdataend'] - $info['avdataoffset'];
69
-		$flv_header = fread($this->getid3->fp, 5);
70
-
71
-		$info['fileformat'] = 'flv';
72
-		$info_flv['header']['signature'] =                           substr($flv_header, 0, 3);
73
-		$info_flv['header']['version']   = getid3_lib::BigEndian2Int(substr($flv_header, 3, 1));
74
-		$type_flags                      = getid3_lib::BigEndian2Int(substr($flv_header, 4, 1));
75
-
76
-		$info_flv['header']['hasAudio'] = (bool) ($type_flags & 0x04);
77
-		$info_flv['header']['hasVideo'] = (bool) ($type_flags & 0x01);
78
-
79
-		$frame_size_data_length = getid3_lib::BigEndian2Int(fread($this->getid3->fp, 4));
80
-		$flv_header_frame_length = 9;
81
-		if ($frame_size_data_length > $flv_header_frame_length) {
82
-			fseek($this->getid3->fp, $frame_size_data_length - $flv_header_frame_length, SEEK_CUR);
83
-		}
84
-
85
-		$duration = 0;
86
-		while ((ftell($this->getid3->fp) + 1) < $info['avdataend']) {
87
-
88
-			$this_tag_header = fread($this->getid3->fp, 16);
89
-
90
-			$previous_tag_length = getid3_lib::BigEndian2Int(substr($this_tag_header,  0, 4));
91
-			$tag_type            = getid3_lib::BigEndian2Int(substr($this_tag_header,  4, 1));
92
-			$data_length         = getid3_lib::BigEndian2Int(substr($this_tag_header,  5, 3));
93
-			$timestamp           = getid3_lib::BigEndian2Int(substr($this_tag_header,  8, 3));
94
-			$last_header_byte    = getid3_lib::BigEndian2Int(substr($this_tag_header, 15, 1));
95
-			$next_offset         = ftell($this->getid3->fp) - 1 + $data_length;
96
-
97
-			switch ($tag_type) {
98
-
99
-				case getid3_flv::TAG_AUDIO:
100
-					if (!isset($info_flv['audio']['audioFormat'])) {
101
-						$info_flv['audio']['audioFormat']     =  $last_header_byte & 0x07;
102
-						$info_flv['audio']['audioRate']       = ($last_header_byte & 0x30) / 0x10;
103
-						$info_flv['audio']['audioSampleSize'] = ($last_header_byte & 0x40) / 0x40;
104
-						$info_flv['audio']['audioType']       = ($last_header_byte & 0x80) / 0x80;
105
-					}
106
-					break;
107
-
108
-
109
-				case getid3_flv::TAG_VIDEO:
110
-					if (!isset($info_flv['video']['videoCodec'])) {
111
-						$info_flv['video']['videoCodec'] = $last_header_byte & 0x07;
112
-
113
-						$flv_video_header = fread($this->getid3->fp, 11);
114
-
115
-						if ($info_flv['video']['videoCodec'] != getid3_flv::VIDEO_VP6) {
116
-
117
-							$picture_size_type = (getid3_lib::BigEndian2Int(substr($flv_video_header, 3, 2))) >> 7;
118
-							$picture_size_type = $picture_size_type & 0x0007;
119
-							$info_flv['header']['videoSizeType'] = $picture_size_type;
120
-
121
-							switch ($picture_size_type) {
122
-								case 0:
123
-									$picture_size_enc = getid3_lib::BigEndian2Int(substr($flv_video_header, 5, 2));
124
-									$picture_size_enc <<= 1;
125
-									$info['video']['resolution_x'] = ($picture_size_enc & 0xFF00) >> 8;
126
-									$picture_size_enc = getid3_lib::BigEndian2Int(substr($flv_video_header, 6, 2));
127
-									$picture_size_enc <<= 1;
128
-									$info['video']['resolution_y'] = ($picture_size_enc & 0xFF00) >> 8;
129
-									break;
130
-
131
-								case 1:
132
-									$picture_size_enc = getid3_lib::BigEndian2Int(substr($flv_video_header, 5, 4));
133
-									$picture_size_enc <<= 1;
134
-									$info['video']['resolution_x'] = ($picture_size_enc & 0xFFFF0000) >> 16;
135
-
136
-									$picture_size_enc = getid3_lib::BigEndian2Int(substr($flv_video_header, 7, 4));
137
-									$picture_size_enc <<= 1;
138
-									$info['video']['resolution_y'] = ($picture_size_enc & 0xFFFF0000) >> 16;
139
-									break;
140
-
141
-								case 2:
142
-									$info['video']['resolution_x'] = 352;
143
-									$info['video']['resolution_y'] = 288;
144
-									break;
145
-
146
-								case 3:
147
-									$info['video']['resolution_x'] = 176;
148
-									$info['video']['resolution_y'] = 144;
149
-									break;
150
-
151
-								case 4:
152
-									$info['video']['resolution_x'] = 128;
153
-									$info['video']['resolution_y'] = 96;
154
-									break;
155
-
156
-								case 5:
157
-									$info['video']['resolution_x'] = 320;
158
-									$info['video']['resolution_y'] = 240;
159
-									break;
160
-
161
-								case 6:
162
-									$info['video']['resolution_x'] = 160;
163
-									$info['video']['resolution_y'] = 120;
164
-									break;
165
-
166
-								default:
167
-									$info['video']['resolution_x'] = 0;
168
-									$info['video']['resolution_y'] = 0;
169
-									break;
170
-							}
171
-						}
172
-					}
173
-					break;
174
-
175
-
176
-				// Meta tag
177
-				case getid3_flv::TAG_META:
178
-
179
-					fseek($this->getid3->fp, -1, SEEK_CUR);
180
-					$reader = new AMFReader(new AMFStream(fread($this->getid3->fp, $data_length)));
181
-					$event_name = $reader->readData();
182
-					$info['meta'][$event_name] = $reader->readData();
183
-					unset($reader);
184
-
185
-					$info['video']['frame_rate']   = @$info['meta']['onMetaData']['framerate'];
186
-					$info['video']['resolution_x'] = @$info['meta']['onMetaData']['width'];
187
-					$info['video']['resolution_y'] = @$info['meta']['onMetaData']['height'];
188
-					break;
189
-
190
-				default:
191
-					// noop
192
-					break;
193
-			}
194
-
195
-			if ($timestamp > $duration) {
196
-				$duration = $timestamp;
197
-			}
198
-
199
-			fseek($this->getid3->fp, $next_offset, SEEK_SET);
200
-		}
201
-
202
-		if ($info['playtime_seconds'] = $duration / 1000) {
203
-		    $info['bitrate'] = ($info['avdataend'] - $info['avdataoffset']) / $info['playtime_seconds'];
204
-		}
205
-
206
-		if ($info_flv['header']['hasAudio']) {
207
-			$info['audio']['codec']           = $this->FLVaudioFormat($info_flv['audio']['audioFormat']);
208
-			$info['audio']['sample_rate']     = $this->FLVaudioRate($info_flv['audio']['audioRate']);
209
-			$info['audio']['bits_per_sample'] = $this->FLVaudioBitDepth($info_flv['audio']['audioSampleSize']);
210
-
211
-			$info['audio']['channels']   = $info_flv['audio']['audioType'] + 1; // 0=mono,1=stereo
212
-			$info['audio']['lossless']   = ($info_flv['audio']['audioFormat'] ? false : true); // 0=uncompressed
213
-			$info['audio']['dataformat'] = 'flv';
214
-		}
215
-		if (@$info_flv['header']['hasVideo']) {
216
-			$info['video']['codec']      = $this->FLVvideoCodec($info_flv['video']['videoCodec']);
217
-			$info['video']['dataformat'] = 'flv';
218
-			$info['video']['lossless']   = false;
219
-		}
220
-
221
-		return true;
222
-	}
223
-
224
-
225
-	public static function FLVaudioFormat($id) {
226
-
227
-		static $lookup = array(
228
-			0 => 'uncompressed',
229
-			1 => 'ADPCM',
230
-			2 => 'mp3',
231
-			5 => 'Nellymoser 8kHz mono',
232
-			6 => 'Nellymoser',
233
-		);
234
-		return (@$lookup[$id] ? @$lookup[$id] : false);
235
-	}
236
-
237
-
238
-	public static function FLVaudioRate($id) {
239
-
240
-		static $lookup = array(
241
-			0 =>  5500,
242
-			1 => 11025,
243
-			2 => 22050,
244
-			3 => 44100,
245
-		);
246
-		return (@$lookup[$id] ? @$lookup[$id] : false);
247
-	}
248
-
249
-
250
-	public static function FLVaudioBitDepth($id) {
251
-
252
-		static $lookup = array(
253
-			0 =>  8,
254
-			1 => 16,
255
-		);
256
-		return (@$lookup[$id] ? @$lookup[$id] : false);
257
-	}
258
-
259
-
260
-	public static function FLVvideoCodec($id) {
261
-
262
-		static $lookup = array(
263
-			getid3_flv::VIDEO_H263   => 'Sorenson H.263',
264
-			getid3_flv::VIDEO_SCREEN => 'Screen video',
265
-			getid3_flv::VIDEO_VP6    => 'On2 VP6',
266
-		);
267
-		return (@$lookup[$id] ? @$lookup[$id] : false);
268
-	}
59
+    public function Analyze()
60
+    {
61
+        $info = &$this->getid3->info;
62
+
63
+        $info['flv'] = array ();
64
+        $info_flv = &$info['flv'];
65
+
66
+        fseek($this->getid3->fp, $info['avdataoffset'], SEEK_SET);
67
+
68
+        $flv_data_length = $info['avdataend'] - $info['avdataoffset'];
69
+        $flv_header = fread($this->getid3->fp, 5);
70
+
71
+        $info['fileformat'] = 'flv';
72
+        $info_flv['header']['signature'] =                           substr($flv_header, 0, 3);
73
+        $info_flv['header']['version']   = getid3_lib::BigEndian2Int(substr($flv_header, 3, 1));
74
+        $type_flags                      = getid3_lib::BigEndian2Int(substr($flv_header, 4, 1));
75
+
76
+        $info_flv['header']['hasAudio'] = (bool) ($type_flags & 0x04);
77
+        $info_flv['header']['hasVideo'] = (bool) ($type_flags & 0x01);
78
+
79
+        $frame_size_data_length = getid3_lib::BigEndian2Int(fread($this->getid3->fp, 4));
80
+        $flv_header_frame_length = 9;
81
+        if ($frame_size_data_length > $flv_header_frame_length) {
82
+            fseek($this->getid3->fp, $frame_size_data_length - $flv_header_frame_length, SEEK_CUR);
83
+        }
84
+
85
+        $duration = 0;
86
+        while ((ftell($this->getid3->fp) + 1) < $info['avdataend']) {
87
+
88
+            $this_tag_header = fread($this->getid3->fp, 16);
89
+
90
+            $previous_tag_length = getid3_lib::BigEndian2Int(substr($this_tag_header,  0, 4));
91
+            $tag_type            = getid3_lib::BigEndian2Int(substr($this_tag_header,  4, 1));
92
+            $data_length         = getid3_lib::BigEndian2Int(substr($this_tag_header,  5, 3));
93
+            $timestamp           = getid3_lib::BigEndian2Int(substr($this_tag_header,  8, 3));
94
+            $last_header_byte    = getid3_lib::BigEndian2Int(substr($this_tag_header, 15, 1));
95
+            $next_offset         = ftell($this->getid3->fp) - 1 + $data_length;
96
+
97
+            switch ($tag_type) {
98
+
99
+                case getid3_flv::TAG_AUDIO:
100
+                    if (!isset($info_flv['audio']['audioFormat'])) {
101
+                        $info_flv['audio']['audioFormat']     =  $last_header_byte & 0x07;
102
+                        $info_flv['audio']['audioRate']       = ($last_header_byte & 0x30) / 0x10;
103
+                        $info_flv['audio']['audioSampleSize'] = ($last_header_byte & 0x40) / 0x40;
104
+                        $info_flv['audio']['audioType']       = ($last_header_byte & 0x80) / 0x80;
105
+                    }
106
+                    break;
107
+
108
+
109
+                case getid3_flv::TAG_VIDEO:
110
+                    if (!isset($info_flv['video']['videoCodec'])) {
111
+                        $info_flv['video']['videoCodec'] = $last_header_byte & 0x07;
112
+
113
+                        $flv_video_header = fread($this->getid3->fp, 11);
114
+
115
+                        if ($info_flv['video']['videoCodec'] != getid3_flv::VIDEO_VP6) {
116
+
117
+                            $picture_size_type = (getid3_lib::BigEndian2Int(substr($flv_video_header, 3, 2))) >> 7;
118
+                            $picture_size_type = $picture_size_type & 0x0007;
119
+                            $info_flv['header']['videoSizeType'] = $picture_size_type;
120
+
121
+                            switch ($picture_size_type) {
122
+                                case 0:
123
+                                    $picture_size_enc = getid3_lib::BigEndian2Int(substr($flv_video_header, 5, 2));
124
+                                    $picture_size_enc <<= 1;
125
+                                    $info['video']['resolution_x'] = ($picture_size_enc & 0xFF00) >> 8;
126
+                                    $picture_size_enc = getid3_lib::BigEndian2Int(substr($flv_video_header, 6, 2));
127
+                                    $picture_size_enc <<= 1;
128
+                                    $info['video']['resolution_y'] = ($picture_size_enc & 0xFF00) >> 8;
129
+                                    break;
130
+
131
+                                case 1:
132
+                                    $picture_size_enc = getid3_lib::BigEndian2Int(substr($flv_video_header, 5, 4));
133
+                                    $picture_size_enc <<= 1;
134
+                                    $info['video']['resolution_x'] = ($picture_size_enc & 0xFFFF0000) >> 16;
135
+
136
+                                    $picture_size_enc = getid3_lib::BigEndian2Int(substr($flv_video_header, 7, 4));
137
+                                    $picture_size_enc <<= 1;
138
+                                    $info['video']['resolution_y'] = ($picture_size_enc & 0xFFFF0000) >> 16;
139
+                                    break;
140
+
141
+                                case 2:
142
+                                    $info['video']['resolution_x'] = 352;
143
+                                    $info['video']['resolution_y'] = 288;
144
+                                    break;
145
+
146
+                                case 3:
147
+                                    $info['video']['resolution_x'] = 176;
148
+                                    $info['video']['resolution_y'] = 144;
149
+                                    break;
150
+
151
+                                case 4:
152
+                                    $info['video']['resolution_x'] = 128;
153
+                                    $info['video']['resolution_y'] = 96;
154
+                                    break;
155
+
156
+                                case 5:
157
+                                    $info['video']['resolution_x'] = 320;
158
+                                    $info['video']['resolution_y'] = 240;
159
+                                    break;
160
+
161
+                                case 6:
162
+                                    $info['video']['resolution_x'] = 160;
163
+                                    $info['video']['resolution_y'] = 120;
164
+                                    break;
165
+
166
+                                default:
167
+                                    $info['video']['resolution_x'] = 0;
168
+                                    $info['video']['resolution_y'] = 0;
169
+                                    break;
170
+                            }
171
+                        }
172
+                    }
173
+                    break;
174
+
175
+
176
+                // Meta tag
177
+                case getid3_flv::TAG_META:
178
+
179
+                    fseek($this->getid3->fp, -1, SEEK_CUR);
180
+                    $reader = new AMFReader(new AMFStream(fread($this->getid3->fp, $data_length)));
181
+                    $event_name = $reader->readData();
182
+                    $info['meta'][$event_name] = $reader->readData();
183
+                    unset($reader);
184
+
185
+                    $info['video']['frame_rate']   = @$info['meta']['onMetaData']['framerate'];
186
+                    $info['video']['resolution_x'] = @$info['meta']['onMetaData']['width'];
187
+                    $info['video']['resolution_y'] = @$info['meta']['onMetaData']['height'];
188
+                    break;
189
+
190
+                default:
191
+                    // noop
192
+                    break;
193
+            }
194
+
195
+            if ($timestamp > $duration) {
196
+                $duration = $timestamp;
197
+            }
198
+
199
+            fseek($this->getid3->fp, $next_offset, SEEK_SET);
200
+        }
201
+
202
+        if ($info['playtime_seconds'] = $duration / 1000) {
203
+            $info['bitrate'] = ($info['avdataend'] - $info['avdataoffset']) / $info['playtime_seconds'];
204
+        }
205
+
206
+        if ($info_flv['header']['hasAudio']) {
207
+            $info['audio']['codec']           = $this->FLVaudioFormat($info_flv['audio']['audioFormat']);
208
+            $info['audio']['sample_rate']     = $this->FLVaudioRate($info_flv['audio']['audioRate']);
209
+            $info['audio']['bits_per_sample'] = $this->FLVaudioBitDepth($info_flv['audio']['audioSampleSize']);
210
+
211
+            $info['audio']['channels']   = $info_flv['audio']['audioType'] + 1; // 0=mono,1=stereo
212
+            $info['audio']['lossless']   = ($info_flv['audio']['audioFormat'] ? false : true); // 0=uncompressed
213
+            $info['audio']['dataformat'] = 'flv';
214
+        }
215
+        if (@$info_flv['header']['hasVideo']) {
216
+            $info['video']['codec']      = $this->FLVvideoCodec($info_flv['video']['videoCodec']);
217
+            $info['video']['dataformat'] = 'flv';
218
+            $info['video']['lossless']   = false;
219
+        }
220
+
221
+        return true;
222
+    }
223
+
224
+
225
+    public static function FLVaudioFormat($id) {
226
+
227
+        static $lookup = array(
228
+            0 => 'uncompressed',
229
+            1 => 'ADPCM',
230
+            2 => 'mp3',
231
+            5 => 'Nellymoser 8kHz mono',
232
+            6 => 'Nellymoser',
233
+        );
234
+        return (@$lookup[$id] ? @$lookup[$id] : false);
235
+    }
236
+
237
+
238
+    public static function FLVaudioRate($id) {
239
+
240
+        static $lookup = array(
241
+            0 =>  5500,
242
+            1 => 11025,
243
+            2 => 22050,
244
+            3 => 44100,
245
+        );
246
+        return (@$lookup[$id] ? @$lookup[$id] : false);
247
+    }
248
+
249
+
250
+    public static function FLVaudioBitDepth($id) {
251
+
252
+        static $lookup = array(
253
+            0 =>  8,
254
+            1 => 16,
255
+        );
256
+        return (@$lookup[$id] ? @$lookup[$id] : false);
257
+    }
258
+
259
+
260
+    public static function FLVvideoCodec($id) {
261
+
262
+        static $lookup = array(
263
+            getid3_flv::VIDEO_H263   => 'Sorenson H.263',
264
+            getid3_flv::VIDEO_SCREEN => 'Screen video',
265
+            getid3_flv::VIDEO_VP6    => 'On2 VP6',
266
+        );
267
+        return (@$lookup[$id] ? @$lookup[$id] : false);
268
+    }
269 269
 }
270 270
 
271 271
 
272 272
 
273 273
 class AMFStream
274 274
 {
275
-	public $bytes;
276
-	public $pos;
275
+    public $bytes;
276
+    public $pos;
277 277
 
278 278
 
279
-	public function AMFStream($bytes) {
279
+    public function AMFStream($bytes) {
280 280
 
281
-		$this->bytes = $bytes;
282
-		$this->pos = 0;
283
-	}
281
+        $this->bytes = $bytes;
282
+        $this->pos = 0;
283
+    }
284 284
 
285 285
 
286
-	public function readByte() {
286
+    public function readByte() {
287 287
 
288
-		return getid3_lib::BigEndian2Int(substr($this->bytes, $this->pos++, 1));
289
-	}
288
+        return getid3_lib::BigEndian2Int(substr($this->bytes, $this->pos++, 1));
289
+    }
290 290
 
291 291
 
292
-	public function readInt() {
292
+    public function readInt() {
293 293
 
294
-		return ($this->readByte() << 8) + $this->readByte();
295
-	}
294
+        return ($this->readByte() << 8) + $this->readByte();
295
+    }
296 296
 
297 297
 
298
-	public function readLong() {
298
+    public function readLong() {
299 299
 
300
-		return ($this->readByte() << 24) + ($this->readByte() << 16) + ($this->readByte() << 8) + $this->readByte();
301
-	}
300
+        return ($this->readByte() << 24) + ($this->readByte() << 16) + ($this->readByte() << 8) + $this->readByte();
301
+    }
302 302
 
303 303
 
304
-	public function readDouble() {
304
+    public function readDouble() {
305 305
 
306
-		return getid3_lib::BigEndian2Float($this->read(8));
307
-	}
306
+        return getid3_lib::BigEndian2Float($this->read(8));
307
+    }
308 308
 
309 309
 
310
-	public function readUTF() {
310
+    public function readUTF() {
311 311
 
312
-		$length = $this->readInt();
313
-		return $this->read($length);
314
-	}
312
+        $length = $this->readInt();
313
+        return $this->read($length);
314
+    }
315 315
 
316 316
 
317
-	public function readLongUTF() {
317
+    public function readLongUTF() {
318 318
 
319
-		$length = $this->readLong();
320
-		return $this->read($length);
321
-	}
319
+        $length = $this->readLong();
320
+        return $this->read($length);
321
+    }
322 322
 
323 323
 
324
-	public function read($length) {
324
+    public function read($length) {
325 325
 
326
-		$val = substr($this->bytes, $this->pos, $length);
327
-		$this->pos += $length;
328
-		return $val;
329
-	}
326
+        $val = substr($this->bytes, $this->pos, $length);
327
+        $this->pos += $length;
328
+        return $val;
329
+    }
330 330
 
331 331
 
332
-	public function peekByte() {
332
+    public function peekByte() {
333 333
 
334
-		$pos = $this->pos;
335
-		$val = $this->readByte();
336
-		$this->pos = $pos;
337
-		return $val;
338
-	}
334
+        $pos = $this->pos;
335
+        $val = $this->readByte();
336
+        $this->pos = $pos;
337
+        return $val;
338
+    }
339 339
 
340 340
 
341
-	public function peekInt() {
341
+    public function peekInt() {
342 342
 
343
-		$pos = $this->pos;
344
-		$val = $this->readInt();
345
-		$this->pos = $pos;
346
-		return $val;
347
-	}
343
+        $pos = $this->pos;
344
+        $val = $this->readInt();
345
+        $this->pos = $pos;
346
+        return $val;
347
+    }
348 348
 
349 349
 
350
-	public function peekLong() {
350
+    public function peekLong() {
351 351
 
352
-		$pos = $this->pos;
353
-		$val = $this->readLong();
354
-		$this->pos = $pos;
355
-		return $val;
356
-	}
352
+        $pos = $this->pos;
353
+        $val = $this->readLong();
354
+        $this->pos = $pos;
355
+        return $val;
356
+    }
357 357
 
358 358
 
359
-	public function peekDouble() {
359
+    public function peekDouble() {
360 360
 
361
-		$pos = $this->pos;
362
-		$val = $this->readDouble();
363
-		$this->pos = $pos;
364
-		return $val;
365
-	}
361
+        $pos = $this->pos;
362
+        $val = $this->readDouble();
363
+        $this->pos = $pos;
364
+        return $val;
365
+    }
366 366
 
367 367
 
368
-	public function peekUTF() {
368
+    public function peekUTF() {
369 369
 
370
-		$pos = $this->pos;
371
-		$val = $this->readUTF();
372
-		$this->pos = $pos;
373
-		return $val;
374
-	}
370
+        $pos = $this->pos;
371
+        $val = $this->readUTF();
372
+        $this->pos = $pos;
373
+        return $val;
374
+    }
375 375
 
376 376
 
377
-	public function peekLongUTF() {
377
+    public function peekLongUTF() {
378 378
 
379
-		$pos = $this->pos;
380
-		$val = $this->readLongUTF();
381
-		$this->pos = $pos;
382
-		return $val;
383
-	}
379
+        $pos = $this->pos;
380
+        $val = $this->readLongUTF();
381
+        $this->pos = $pos;
382
+        return $val;
383
+    }
384 384
 }
385 385
 
386 386
 
387 387
 
388 388
 class AMFReader
389 389
 {
390
-	public $stream;
390
+    public $stream;
391 391
 
392
-	public function __construct($stream) {
392
+    public function __construct($stream) {
393 393
 
394
-		$this->stream = $stream;
395
-	}
394
+        $this->stream = $stream;
395
+    }
396 396
 
397 397
 
398
-	public function readData() {
398
+    public function readData() {
399 399
 
400
-		$value = null;
400
+        $value = null;
401 401
 
402
-		$type = $this->stream->readByte();
402
+        $type = $this->stream->readByte();
403 403
 
404
-		switch($type) {
405
-			// Double
406
-			case 0:
407
-				$value = $this->readDouble();
408
-			break;
404
+        switch($type) {
405
+            // Double
406
+            case 0:
407
+                $value = $this->readDouble();
408
+            break;
409 409
 
410
-			// Boolean
411
-			case 1:
412
-				$value = $this->readBoolean();
413
-				break;
410
+            // Boolean
411
+            case 1:
412
+                $value = $this->readBoolean();
413
+                break;
414 414
 
415
-			// String
416
-			case 2:
417
-				$value = $this->readString();
418
-				break;
415
+            // String
416
+            case 2:
417
+                $value = $this->readString();
418
+                break;
419 419
 
420
-			// Object
421
-			case 3:
422
-				$value = $this->readObject();
423
-				break;
420
+            // Object
421
+            case 3:
422
+                $value = $this->readObject();
423
+                break;
424 424
 
425
-			// null
426
-			case 6:
427
-				return null;
428
-				break;
425
+            // null
426
+            case 6:
427
+                return null;
428
+                break;
429 429
 
430
-			// Mixed array
431
-			case 8:
432
-				$value = $this->readMixedArray();
433
-				break;
430
+            // Mixed array
431
+            case 8:
432
+                $value = $this->readMixedArray();
433
+                break;
434 434
 
435
-			// Array
436
-			case 10:
437
-				$value = $this->readArray();
438
-				break;
435
+            // Array
436
+            case 10:
437
+                $value = $this->readArray();
438
+                break;
439 439
 
440
-			// Date
441
-			case 11:
442
-				$value = $this->readDate();
443
-				break;
440
+            // Date
441
+            case 11:
442
+                $value = $this->readDate();
443
+                break;
444 444
 
445
-			// Long string
446
-			case 13:
447
-				$value = $this->readLongString();
448
-				break;
445
+            // Long string
446
+            case 13:
447
+                $value = $this->readLongString();
448
+                break;
449 449
 
450
-			// XML (handled as string)
451
-			case 15:
452
-				$value = $this->readXML();
453
-				break;
450
+            // XML (handled as string)
451
+            case 15:
452
+                $value = $this->readXML();
453
+                break;
454 454
 
455
-			// Typed object (handled as object)
456
-			case 16:
457
-				$value = $this->readTypedObject();
458
-				break;
455
+            // Typed object (handled as object)
456
+            case 16:
457
+                $value = $this->readTypedObject();
458
+                break;
459 459
 
460
-			// Long string
461
-			default:
462
-				$value = '(unknown or unsupported data type)';
463
-			break;
464
-		}
460
+            // Long string
461
+            default:
462
+                $value = '(unknown or unsupported data type)';
463
+            break;
464
+        }
465 465
 
466
-		return $value;
467
-	}
466
+        return $value;
467
+    }
468 468
 
469 469
 
470
-	public function readDouble() {
470
+    public function readDouble() {
471 471
 
472
-		return $this->stream->readDouble();
473
-	}
472
+        return $this->stream->readDouble();
473
+    }
474 474
 
475 475
 
476
-	public function readBoolean() {
476
+    public function readBoolean() {
477 477
 
478
-		return $this->stream->readByte() == 1;
479
-	}
478
+        return $this->stream->readByte() == 1;
479
+    }
480 480
 
481 481
 
482
-	public function readString() {
482
+    public function readString() {
483 483
 
484
-		return $this->stream->readUTF();
485
-	}
484
+        return $this->stream->readUTF();
485
+    }
486 486
 
487 487
 
488
-	public function readObject() {
488
+    public function readObject() {
489 489
 
490
-		// Get highest numerical index - ignored
491
-		$highestIndex = $this->stream->readLong();
490
+        // Get highest numerical index - ignored
491
+        $highestIndex = $this->stream->readLong();
492 492
 
493
-		$data = array();
493
+        $data = array();
494 494
 
495
-		while ($key = $this->stream->readUTF()) {
496
-			// Mixed array record ends with empty string (0x00 0x00) and 0x09
497
-			if (($key == '') && ($this->stream->peekByte() == 0x09)) {
498
-				// Consume byte
499
-				$this->stream->readByte();
500
-				break;
501
-			}
495
+        while ($key = $this->stream->readUTF()) {
496
+            // Mixed array record ends with empty string (0x00 0x00) and 0x09
497
+            if (($key == '') && ($this->stream->peekByte() == 0x09)) {
498
+                // Consume byte
499
+                $this->stream->readByte();
500
+                break;
501
+            }
502 502
 
503
-			$data[$key] = $this->readData();
504
-		}
503
+            $data[$key] = $this->readData();
504
+        }
505 505
 
506
-		return $data;
507
-	}
506
+        return $data;
507
+    }
508 508
 
509 509
 
510
-	public function readMixedArray() {
510
+    public function readMixedArray() {
511 511
 
512
-		// Get highest numerical index - ignored
513
-		$highestIndex = $this->stream->readLong();
512
+        // Get highest numerical index - ignored
513
+        $highestIndex = $this->stream->readLong();
514 514
 
515
-		$data = array();
515
+        $data = array();
516 516
 
517
-		while ($key = $this->stream->readUTF()) {
518
-			// Mixed array record ends with empty string (0x00 0x00) and 0x09
519
-			if (($key == '') && ($this->stream->peekByte() == 0x09)) {
520
-				// Consume byte
521
-				$this->stream->readByte();
522
-				break;
523
-			}
517
+        while ($key = $this->stream->readUTF()) {
518
+            // Mixed array record ends with empty string (0x00 0x00) and 0x09
519
+            if (($key == '') && ($this->stream->peekByte() == 0x09)) {
520
+                // Consume byte
521
+                $this->stream->readByte();
522
+                break;
523
+            }
524 524
 
525
-			if (is_numeric($key)) {
526
-				$key = (float) $key;
527
-			}
525
+            if (is_numeric($key)) {
526
+                $key = (float) $key;
527
+            }
528 528
 
529
-			$data[$key] = $this->readData();
530
-		}
529
+            $data[$key] = $this->readData();
530
+        }
531 531
 
532
-		return $data;
533
-	}
532
+        return $data;
533
+    }
534 534
 
535 535
 
536
-	public function readArray() {
536
+    public function readArray() {
537 537
 
538
-		$length = $this->stream->readLong();
538
+        $length = $this->stream->readLong();
539 539
 
540
-		$data = array();
540
+        $data = array();
541 541
 
542
-		for ($i = 0; $i < count($length); $i++) {
543
-			$data[] = $this->readData();
544
-		}
542
+        for ($i = 0; $i < count($length); $i++) {
543
+            $data[] = $this->readData();
544
+        }
545 545
 
546
-		return $data;
547
-	}
546
+        return $data;
547
+    }
548 548
 
549 549
 
550
-	public function readDate() {
550
+    public function readDate() {
551 551
 
552
-		$timestamp = $this->stream->readDouble();
553
-		$timezone = $this->stream->readInt();
554
-		return $timestamp;
555
-	}
552
+        $timestamp = $this->stream->readDouble();
553
+        $timezone = $this->stream->readInt();
554
+        return $timestamp;
555
+    }
556 556
 
557 557
 
558
-	public function readLongString() {
558
+    public function readLongString() {
559 559
 
560
-		return $this->stream->readLongUTF();
561
-	}
560
+        return $this->stream->readLongUTF();
561
+    }
562 562
 
563 563
 
564
-	public function readXML() {
564
+    public function readXML() {
565 565
 
566
-		return $this->stream->readLongUTF();
567
-	}
566
+        return $this->stream->readLongUTF();
567
+    }
568 568
 
569 569
 
570
-	public function readTypedObject() {
570
+    public function readTypedObject() {
571 571
 
572
-		$className = $this->stream->readUTF();
573
-		return $this->readObject();
574
-	}
572
+        $className = $this->stream->readUTF();
573
+        return $this->readObject();
574
+    }
575 575
 }
576 576
 
577 577
 ?>
Please login to merge, or discard this patch.
main/inc/lib/text.lib.php 1 patch
Indentation   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -693,8 +693,8 @@  discard block
 block discarded – undo
693 693
  */
694 694
 function get_week_from_day($date) {
695 695
     if (!empty($date)) {
696
-       $time = api_strtotime($date,'UTC');
697
-       return date('W', $time);
696
+        $time = api_strtotime($date,'UTC');
697
+        return date('W', $time);
698 698
     } else {
699 699
         return date('W');
700 700
     }
@@ -712,31 +712,31 @@  discard block
 block discarded – undo
712 712
 
713 713
 function substrwords($text,$maxchar,$end='...')
714 714
 {
715
-	if(strlen($text)>$maxchar)
716
-	{
717
-		$words=explode(" ",$text);
718
-		$output = '';
719
-		$i=0;
720
-		while(1)
721
-		{
722
-			$length = (strlen($output)+strlen($words[$i]));
723
-			if($length>$maxchar)
724
-			{
725
-				break;
726
-			}
727
-			else
728
-			{
729
-				$output = $output." ".$words[$i];
730
-				$i++;
731
-			};
732
-		};
733
-	}
734
-	else
735
-	{
736
-		$output = $text;
737
-		return $output;
738
-	}
739
-	return $output.$end;
715
+    if(strlen($text)>$maxchar)
716
+    {
717
+        $words=explode(" ",$text);
718
+        $output = '';
719
+        $i=0;
720
+        while(1)
721
+        {
722
+            $length = (strlen($output)+strlen($words[$i]));
723
+            if($length>$maxchar)
724
+            {
725
+                break;
726
+            }
727
+            else
728
+            {
729
+                $output = $output." ".$words[$i];
730
+                $i++;
731
+            };
732
+        };
733
+    }
734
+    else
735
+    {
736
+        $output = $text;
737
+        return $output;
738
+    }
739
+    return $output.$end;
740 740
 }
741 741
 
742 742
 function implode_with_key($glue, $array) {
Please login to merge, or discard this patch.
main/inc/lib/system/web/request.class.php 1 patch
Indentation   -1 removed lines patch added patch discarded remove patch
@@ -16,7 +16,6 @@
 block discarded – undo
16 16
  * @author Patrick Cool
17 17
  * @author René Haentjens, added CSV file import (October 2004)
18 18
  * @package chamilo.link
19
-
20 19
  */
21 20
 
22 21
 // Including libraries
Please login to merge, or discard this patch.
main/inc/lib/internationalization_database/transliteration/x03.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -2,7 +2,7 @@
 block discarded – undo
2 2
 // $Id: xfd.php,v 1.1.8.1 2008/06/12 20:34:32 smk Exp $
3 3
 
4 4
 return array(
5
-  'en' => array('', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '',
5
+    'en' => array('', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '',
6 6
     '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '',
7 7
     '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '',
8 8
     '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '',
Please login to merge, or discard this patch.
main/inc/lib/internationalization_database/transliteration/x17.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -2,7 +2,7 @@
 block discarded – undo
2 2
 // $Id: x05.php,v 1.1.8.1 2008/06/12 20:34:31 smk Exp $
3 3
 
4 4
 return array(
5
-  'en' => array(NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
5
+    'en' => array(NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
6 6
     NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
7 7
     NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
8 8
     NULL, 'A', 'B', 'G', 'D', 'E', 'Z', 'E', 'E', 'T`', 'Zh', 'I', 'L', 'Kh', 'Ts', 'K',
Please login to merge, or discard this patch.
main/inc/lib/internationalization_database/transliteration/x4d.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -2,7 +2,7 @@
 block discarded – undo
2 2
 // $Id: x05.php,v 1.1.8.1 2008/06/12 20:34:31 smk Exp $
3 3
 
4 4
 return array(
5
-  'en' => array(NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
5
+    'en' => array(NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
6 6
     NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
7 7
     NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
8 8
     NULL, 'A', 'B', 'G', 'D', 'E', 'Z', 'E', 'E', 'T`', 'Zh', 'I', 'L', 'Kh', 'Ts', 'K',
Please login to merge, or discard this patch.