Browse Source

Bug fixed with the Offset in trimString function.

Victor De la Rocha 16 years ago
parent
commit
87a8876594
1 changed files with 64 additions and 62 deletions
  1. 64 62
      classes/functions.php

+ 64 - 62
classes/functions.php View File

1
 <?php
1
 <?php
2
-if(!defined('entry') || !entry) die('Not a valid page'); 
2
+if(!defined('entry') || !entry) die('Not a valid page');
3
 /* ===========================
3
 /* ===========================
4
 
4
 
5
   gelato CMS - A PHP based tumblelog CMS
5
   gelato CMS - A PHP based tumblelog CMS
15
 	function version() {
15
 	function version() {
16
 		return "1.0";
16
 		return "1.0";
17
 	}
17
 	}
18
-	
18
+
19
 	function codeName() {
19
 	function codeName() {
20
 		return "vaniglia RC1";
20
 		return "vaniglia RC1";
21
 	}
21
 	}
22
-	
22
+
23
 	function beginsWith($str, $sub) {
23
 	function beginsWith($str, $sub) {
24
 		return (strpos($str, $sub) === 0);
24
 		return (strpos($str, $sub) === 0);
25
 	}
25
 	}
26
-	
26
+
27
 	function endsWith($str, $sub) {
27
 	function endsWith($str, $sub) {
28
 		return (substr($str, strlen($str) - strlen($sub)) == $sub);
28
 		return (substr($str, strlen($str) - strlen($sub)) == $sub);
29
 	}
29
 	}
30
-	
30
+
31
 	function getFileName($fileUrl) {
31
 	function getFileName($fileUrl) {
32
 		$path = explode('/', $fileUrl);
32
 		$path = explode('/', $fileUrl);
33
 		return $path[count($path)-1];
33
 		return $path[count($path)-1];
34
 	}
34
 	}
35
-	
35
+
36
 	function isMP3($fileUrl) {
36
 	function isMP3($fileUrl) {
37
 		if (endsWith($fileUrl, ".mp3")) {
37
 		if (endsWith($fileUrl, ".mp3")) {
38
 			return true;
38
 			return true;
39
 		} else {
39
 		} else {
40
 			return false;
40
 			return false;
41
 		}
41
 		}
42
-	}	
43
-	
42
+	}
43
+
44
 	function getMP3File($remoteFileName) {
44
 	function getMP3File($remoteFileName) {
45
 		if (isMP3($remoteFileName)) {
45
 		if (isMP3($remoteFileName)) {
46
 			if (getFile($remoteFileName)) {
46
 			if (getFile($remoteFileName)) {
51
 		} elseif (isGoEar($remoteFileName)) {
51
 		} elseif (isGoEar($remoteFileName)) {
52
 			return true;
52
 			return true;
53
 		} elseif (isOdeo($remoteFileName)) {
53
 		} elseif (isOdeo($remoteFileName)) {
54
-			return true;			
54
+			return true;
55
 		} else {
55
 		} else {
56
 			return false;
56
 			return false;
57
 		}
57
 		}
58
 	}
58
 	}
59
-	
59
+
60
 	function getGoEarCode($songUrl) {
60
 	function getGoEarCode($songUrl) {
61
 		$pos = strpos($songUrl, "?v=");
61
 		$pos = strpos($songUrl, "?v=");
62
 		$lon = strlen($songUrl);
62
 		$lon = strlen($songUrl);
63
 		$str = substr($songUrl, $pos + 3, $lon);
63
 		$str = substr($songUrl, $pos + 3, $lon);
64
 		return $str;
64
 		return $str;
65
 	}
65
 	}
66
-	
66
+
67
 	function isGoEar($songUrl) {
67
 	function isGoEar($songUrl) {
68
 		if (beginsWith($songUrl, "http://www.goear.com/listen.php?v=") || beginsWith($songUrl, "http://goear.com/listen.php?v="))
68
 		if (beginsWith($songUrl, "http://www.goear.com/listen.php?v=") || beginsWith($songUrl, "http://goear.com/listen.php?v="))
69
 			return true;
69
 			return true;
70
 		else
70
 		else
71
 			return false;
71
 			return false;
72
 	}
72
 	}
73
-	
73
+
74
 	function isOdeo($songUrl){
74
 	function isOdeo($songUrl){
75
 		if (beginsWith($songUrl, "http://odeo.com/audio/") || beginsWith($songUrl, "http://www.odeo.com/audio/"))
75
 		if (beginsWith($songUrl, "http://odeo.com/audio/") || beginsWith($songUrl, "http://www.odeo.com/audio/"))
76
 			return true;
76
 			return true;
77
 		else
77
 		else
78
 			return false;
78
 			return false;
79
 	}
79
 	}
80
-	
80
+
81
 	function getOdeoCode($songUrl) {
81
 	function getOdeoCode($songUrl) {
82
 		$params = explode("audio/", $songUrl);
82
 		$params = explode("audio/", $songUrl);
83
 		$params2 = explode("/",$params[1]);
83
 		$params2 = explode("/",$params[1]);
84
 		return $params2[0];
84
 		return $params2[0];
85
 	}
85
 	}
86
-	
86
+
87
 	function isImageFile($photoUrl) {
87
 	function isImageFile($photoUrl) {
88
 		if (endsWith($photoUrl, ".jpg")) { return true; }
88
 		if (endsWith($photoUrl, ".jpg")) { return true; }
89
 		elseif (endsWith($photoUrl, ".gif")) { return true; }
89
 		elseif (endsWith($photoUrl, ".gif")) { return true; }
90
 		elseif (endsWith($photoUrl, ".png")) { return true; }
90
 		elseif (endsWith($photoUrl, ".png")) { return true; }
91
 		else { return false; }
91
 		else { return false; }
92
 	}
92
 	}
93
-	
93
+
94
 	function getPhotoFile($remoteFileName) {
94
 	function getPhotoFile($remoteFileName) {
95
-		if (isImageFile($remoteFileName)) {		
95
+		if (isImageFile($remoteFileName)) {
96
 			if (getFile($remoteFileName)) {
96
 			if (getFile($remoteFileName)) {
97
 				return true;
97
 				return true;
98
 			} else {
98
 			} else {
102
 			return false;
102
 			return false;
103
 		}
103
 		}
104
 	}
104
 	}
105
-	
105
+
106
 	function getFile($remoteFileName) {
106
 	function getFile($remoteFileName) {
107
-		$fileName = "../uploads/".sanitizeName(getFileName($remoteFileName));		
107
+		$fileName = "../uploads/".sanitizeName(getFileName($remoteFileName));
108
 		$str = _file_get_contents($remoteFileName);
108
 		$str = _file_get_contents($remoteFileName);
109
 		if (!$handle = fopen($fileName, 'w')) {
109
 		if (!$handle = fopen($fileName, 'w')) {
110
 			//die("no se abrio de escritura");
110
 			//die("no se abrio de escritura");
111
 			return false;
111
 			return false;
112
 		}
112
 		}
113
-		
113
+
114
 		if (fwrite($handle, $str) === FALSE) {
114
 		if (fwrite($handle, $str) === FALSE) {
115
 			//die("no se escribio");
115
 			//die("no se escribio");
116
 			return false;
116
 			return false;
117
 		}
117
 		}
118
 		fclose($handle);
118
 		fclose($handle);
119
-		return true;	
119
+		return true;
120
 	}
120
 	}
121
-	
121
+
122
 	function isVimeoVideo($videoUrl) {
122
 	function isVimeoVideo($videoUrl) {
123
 		if (beginsWith($videoUrl, "http://vimeo.com/") || beginsWith($videoUrl, "http://www.vimeo.com/"))
123
 		if (beginsWith($videoUrl, "http://vimeo.com/") || beginsWith($videoUrl, "http://www.vimeo.com/"))
124
 			return true;
124
 			return true;
125
 		else
125
 		else
126
 			return false;
126
 			return false;
127
 	}
127
 	}
128
-	
128
+
129
 	function getVimeoVideoUrl($videoUrl) {
129
 	function getVimeoVideoUrl($videoUrl) {
130
 		if(substr_count($videoUrl,"clip:")==1)
130
 		if(substr_count($videoUrl,"clip:")==1)
131
 			return array_pop(explode("clip:",$videoUrl));
131
 			return array_pop(explode("clip:",$videoUrl));
132
 		else
132
 		else
133
 			return array_pop(explode("/",$videoUrl));
133
 			return array_pop(explode("/",$videoUrl));
134
 	}
134
 	}
135
-	
135
+
136
 	function isYoutubeVideo($videoUrl) {
136
 	function isYoutubeVideo($videoUrl) {
137
 		$url = explode("?", $videoUrl);
137
 		$url = explode("?", $videoUrl);
138
 		if((beginsWith($url[0], "http://") && endsWith($url[0], ".youtube.com/watch")) || beginsWith($url[0], "http://youtube.com/watch"))
138
 		if((beginsWith($url[0], "http://") && endsWith($url[0], ".youtube.com/watch")) || beginsWith($url[0], "http://youtube.com/watch"))
140
 		else
140
 		else
141
 			return false;
141
 			return false;
142
 	}
142
 	}
143
-	
143
+
144
 	function isYahooVideo($videoUrl){
144
 	function isYahooVideo($videoUrl){
145
 		if (beginsWith($videoUrl, "http://video.yahoo.com/watch/") || beginsWith($videoUrl, "http://www.video.yahoo.com/watch/"))
145
 		if (beginsWith($videoUrl, "http://video.yahoo.com/watch/") || beginsWith($videoUrl, "http://www.video.yahoo.com/watch/"))
146
 			return true;
146
 			return true;
147
 		else
147
 		else
148
 			return false;
148
 			return false;
149
 	}
149
 	}
150
-	
150
+
151
 	function getYahooVideoCode($videoUrl){
151
 	function getYahooVideoCode($videoUrl){
152
 		$params = explode("http://video.yahoo.com/watch/", $videoUrl);
152
 		$params = explode("http://video.yahoo.com/watch/", $videoUrl);
153
 		$params2 = explode("/",$params[1]);
153
 		$params2 = explode("/",$params[1]);
160
 		$params2 = explode("&",$params[1]);
160
 		$params2 = explode("&",$params[1]);
161
 		return $params2[0];
161
 		return $params2[0];
162
 	}
162
 	}
163
-	
163
+
164
 	function isGoogleVideoUrl($videoUrl){
164
 	function isGoogleVideoUrl($videoUrl){
165
 		if (beginsWith($videoUrl, "http://video.google.com/videoplay?")){
165
 		if (beginsWith($videoUrl, "http://video.google.com/videoplay?")){
166
 			return true;
166
 			return true;
168
 			return false;
168
 			return false;
169
 		}
169
 		}
170
 	}
170
 	}
171
-	
171
+
172
 	function getGoogleVideoCode($videoUrl){
172
 	function getGoogleVideoCode($videoUrl){
173
 		$params = explode("?docid=", $videoUrl);
173
 		$params = explode("?docid=", $videoUrl);
174
 		$params2 = explode("&",$params[1]);
174
 		$params2 = explode("&",$params[1]);
175
 		return $params2[0];
175
 		return $params2[0];
176
 	}
176
 	}
177
-	
177
+
178
 	function isDailymotionVideo($videoUrl) {
178
 	function isDailymotionVideo($videoUrl) {
179
 		if (beginsWith($videoUrl, "http://www.dailymotion.com/video/") || beginsWith($videoUrl, "http://dailymotion.com/video/"))
179
 		if (beginsWith($videoUrl, "http://www.dailymotion.com/video/") || beginsWith($videoUrl, "http://dailymotion.com/video/"))
180
 			return true;
180
 			return true;
187
 		$params2 = explode("_",$params[1]);
187
 		$params2 = explode("_",$params[1]);
188
 		return $params2[0];
188
 		return $params2[0];
189
 	}
189
 	}
190
-	
190
+
191
 	function isSlideSharePresentation($videoUrl) {
191
 	function isSlideSharePresentation($videoUrl) {
192
 		if (beginsWith($videoUrl, "[slideshare id="))
192
 		if (beginsWith($videoUrl, "[slideshare id="))
193
 			return true;
193
 			return true;
194
 		else
194
 		else
195
 			return false;
195
 			return false;
196
 	}
196
 	}
197
-	
197
+
198
 	function getSlideSharePresentationCode($videoUrl) {
198
 	function getSlideSharePresentationCode($videoUrl) {
199
 		$videoUrl = str_replace("[slideshare id=", "", $videoUrl);
199
 		$videoUrl = str_replace("[slideshare id=", "", $videoUrl);
200
 		$videoUrl = str_replace("&doc=", " ", $videoUrl);
200
 		$videoUrl = str_replace("&doc=", " ", $videoUrl);
201
 		$videoUrl = str_replace("&w=", " ", $videoUrl);
201
 		$videoUrl = str_replace("&w=", " ", $videoUrl);
202
 		return explode(" ",$videoUrl);
202
 		return explode(" ",$videoUrl);
203
 	}
203
 	}
204
-	
204
+
205
 	function isVideo($url) {
205
 	function isVideo($url) {
206
 		if (isYoutubeVideo($url)) { return true; }
206
 		if (isYoutubeVideo($url)) { return true; }
207
 		elseif (isVimeoVideo($url)) { return true; }
207
 		elseif (isVimeoVideo($url)) { return true; }
211
 		elseif (isGoogleVideoUrl($url)) { return true; }
211
 		elseif (isGoogleVideoUrl($url)) { return true; }
212
 		else { return false; }
212
 		else { return false; }
213
 	}
213
 	}
214
-	
215
-	function sendMail($to, $title, $body, $from) {					
214
+
215
+	function sendMail($to, $title, $body, $from) {
216
 		$rp     = trim($from);
216
 		$rp     = trim($from);
217
 		$org    = "gelato CMS";
217
 		$org    = "gelato CMS";
218
 		$mailer = "gelato CMS Mailer";
218
 		$mailer = "gelato CMS Mailer";
219
-			
219
+
220
 		$head  = '';
220
 		$head  = '';
221
 		$head  .= "Content-Type: text/html \r\n";
221
 		$head  .= "Content-Type: text/html \r\n";
222
 		$head  .= "Date: ". date('r'). " \r\n";
222
 		$head  .= "Date: ". date('r'). " \r\n";
228
 		$head  .= "X-Sender: $from \r\n";
228
 		$head  .= "X-Sender: $from \r\n";
229
 		$head  .= "X-Priority: 3 \r\n";
229
 		$head  .= "X-Priority: 3 \r\n";
230
 		$head  .= "X-Mailer: $mailer \r\n";
230
 		$head  .= "X-Mailer: $mailer \r\n";
231
-			
231
+
232
 		$body  = str_replace("\r\n", "\n", $body);
232
 		$body  = str_replace("\r\n", "\n", $body);
233
 		$body  = str_replace("\n", "\r\n", $body);
233
 		$body  = str_replace("\n", "\r\n", $body);
234
-			
235
-		return @mail($to, $title, $body, $head);			
234
+
235
+		return @mail($to, $title, $body, $head);
236
 	}
236
 	}
237
-	
237
+
238
 	function getThemes() {
238
 	function getThemes() {
239
  		$themes_dir = "themes";
239
  		$themes_dir = "themes";
240
  		$dirs = array();
240
  		$dirs = array();
262
 		//HACK: We need to rework the regular expression to allow the dot
262
 		//HACK: We need to rework the regular expression to allow the dot
263
 		$ext = substr($name, strlen($name)-3, strlen($name));
263
 		$ext = substr($name, strlen($name)-3, strlen($name));
264
 		$body = substr($name, 0, strlen($name)-4);
264
 		$body = substr($name, 0, strlen($name)-4);
265
-		
265
+
266
 		$name = $body.".".$ext;
266
 		$name = $body.".".$ext;
267
-		
267
+
268
 		return $name;
268
 		return $name;
269
 	}
269
 	}
270
-	
270
+
271
 	function _file_get_contents($path) {
271
 	function _file_get_contents($path) {
272
-		// Modified function from: 
272
+		// Modified function from:
273
 		//		http://work.dokoku.net/Anieto2k/_file_get_contents.phps
273
 		//		http://work.dokoku.net/Anieto2k/_file_get_contents.phps
274
 		//		http://www.anieto2k.com/2007/02/09/file_get_contents-y-dreamhost/
274
 		//		http://www.anieto2k.com/2007/02/09/file_get_contents-y-dreamhost/
275
 		if (!preg_match('/^http/i', $path)) {
275
 		if (!preg_match('/^http/i', $path)) {
276
 			if ($fp = fopen($path, 'r')) {
276
 			if ($fp = fopen($path, 'r')) {
277
 				return fread($fp, 1024);
277
 				return fread($fp, 1024);
278
-			} else {			
278
+			} else {
279
 				return false;
279
 				return false;
280
 			}
280
 			}
281
 		} else {
281
 		} else {
297
 				if (!$data['host'] || $data['scheme'] != "http") {
297
 				if (!$data['host'] || $data['scheme'] != "http") {
298
 					return false;
298
 					return false;
299
 				}
299
 				}
300
-		
300
+
301
 				$f = @fsockopen($data['host'], ($data['port']) ? $data['port'] : 80, $e1, $e2, 3);
301
 				$f = @fsockopen($data['host'], ($data['port']) ? $data['port'] : 80, $e1, $e2, 3);
302
 				if (!$f) {
302
 				if (!$f) {
303
 					return false;
303
 					return false;
307
 				$q .= "Host: " . $data['host'] . "\r\n";
307
 				$q .= "Host: " . $data['host'] . "\r\n";
308
 				$q .= "Connection: close\r\n";
308
 				$q .= "Connection: close\r\n";
309
 				$q .= "Referer: http://www.gelatocms.com/\r\n\r\n";
309
 				$q .= "Referer: http://www.gelatocms.com/\r\n\r\n";
310
-		
310
+
311
 				$recv = "";
311
 				$recv = "";
312
 				fwrite($f, $q);
312
 				fwrite($f, $q);
313
 				while (!feof($f)) {
313
 				while (!feof($f)) {
314
 					$recv .= fread($f, 1024);
314
 					$recv .= fread($f, 1024);
315
 				}
315
 				}
316
-		
316
+
317
 				$request = $q;
317
 				$request = $q;
318
 				$response = substr($recv, 0, strpos($recv, "\r\n\r\n"));
318
 				$response = substr($recv, 0, strpos($recv, "\r\n\r\n"));
319
 				$body = substr($recv, strpos($recv, "\r\n\r\n") + 4);
319
 				$body = substr($recv, strpos($recv, "\r\n\r\n") + 4);
320
-		
320
+
321
 				if (preg_match('/http\/1\\.[0|1] ([0-9]{3})/i', $response, $res)) {
321
 				if (preg_match('/http\/1\\.[0|1] ([0-9]{3})/i', $response, $res)) {
322
 					if ($res[1][0] != "2") {
322
 					if ($res[1][0] != "2") {
323
 						return false;
323
 						return false;
325
 				} else {
325
 				} else {
326
 					return false;
326
 					return false;
327
 				}
327
 				}
328
-		
328
+
329
 				if (preg_match('/transfer-encoding:\s*chunked/i', $response)) {
329
 				if (preg_match('/transfer-encoding:\s*chunked/i', $response)) {
330
 					$tmp_body = $body;
330
 					$tmp_body = $body;
331
 					$new = "";
331
 					$new = "";
344
 						}
344
 						}
345
 					}
345
 					}
346
 					$body = $new;
346
 					$body = $new;
347
-				}	
347
+				}
348
 				return $body;
348
 				return $body;
349
 			}
349
 			}
350
 		}
350
 		}
351
 	}
351
 	}
352
-	
352
+
353
 	function get_curl_version() {
353
 	function get_curl_version() {
354
 		$curl = 0;
354
 		$curl = 0;
355
 		if (is_array(curl_version())) {
355
 		if (is_array(curl_version())) {
363
 		}
363
 		}
364
 		return $curl;
364
 		return $curl;
365
 	}
365
 	}
366
-	
366
+
367
 	function transform_offset($offset){
367
 	function transform_offset($offset){
368
 		$sp = strpos($offset , ".")? explode("." , $offset) : false;
368
 		$sp = strpos($offset , ".")? explode("." , $offset) : false;
369
 		if(is_array($sp)){
369
 		if(is_array($sp)){
376
 		}
376
 		}
377
 		return $off;
377
 		return $off;
378
 	}
378
 	}
379
-	
379
+
380
 	function getLangs() {
380
 	function getLangs() {
381
  		$langs_dir = "languages";
381
  		$langs_dir = "languages";
382
  		$dirs = array();
382
  		$dirs = array();
388
 		$cls_lang_dir = @ dir($dir);
388
 		$cls_lang_dir = @ dir($dir);
389
 		while (($directory = $cls_lang_dir->read()) !== false) {
389
 		while (($directory = $cls_lang_dir->read()) !== false) {
390
 			if($directory != "." && $directory != "..") {
390
 			if($directory != "." && $directory != "..") {
391
-				
391
+
392
 				$dir2 = (substr(PHP_OS, 0, 3) == 'WIN') ? $path."\\".$langs_dir."\\".$directory : $path."/".$langs_dir."/".$directory;
392
 				$dir2 = (substr(PHP_OS, 0, 3) == 'WIN') ? $path."\\".$langs_dir."\\".$directory : $path."/".$langs_dir."/".$directory;
393
 				$dir2 = str_replace("admin\\", "", $dir2);
393
 				$dir2 = str_replace("admin\\", "", $dir2);
394
 				$dir2 = str_replace("admin/", "", $dir2);
394
 				$dir2 = str_replace("admin/", "", $dir2);
423
 		$source = strip_tags($source, $validTags);
423
 		$source = strip_tags($source, $validTags);
424
 		return preg_replace('/<(.*?)>/ie', "'<'.removeBadAtributes('\\1').'>'", $source);
424
 		return preg_replace('/<(.*?)>/ie', "'<'.removeBadAtributes('\\1').'>'", $source);
425
 	}
425
 	}
426
-	
426
+
427
 	function removeBadAtributes($sourceTag) {
427
 	function removeBadAtributes($sourceTag) {
428
 		$badAtributes = 'javascript:|onclick|ondblclick|onmousedown|onmouseup|onmouseover|onmousemove|onmouseout|onkeypress|onkeydown|onkeyup';
428
 		$badAtributes = 'javascript:|onclick|ondblclick|onmousedown|onmouseup|onmouseover|onmousemove|onmouseout|onkeypress|onkeydown|onkeyup';
429
 		$sourceTag = stripslashes($sourceTag);
429
 		$sourceTag = stripslashes($sourceTag);
430
 		$sourceTag = preg_replace("/$badAtributes/i", "niceTry", $sourceTag);
430
 		$sourceTag = preg_replace("/$badAtributes/i", "niceTry", $sourceTag);
431
 		return $sourceTag;
431
 		return $sourceTag;
432
 	}
432
 	}
433
-	
433
+
434
 	function type2Text($number) {
434
 	function type2Text($number) {
435
 		$tmpStr = "";
435
 		$tmpStr = "";
436
 		switch ($number) {
436
 		switch ($number) {
438
 				$tmpStr = "post";
438
 				$tmpStr = "post";
439
 				break;
439
 				break;
440
 			case "2":
440
 			case "2":
441
-				$tmpStr = "photo";							   
441
+				$tmpStr = "photo";
442
 				break;
442
 				break;
443
 			case "3":
443
 			case "3":
444
 				$tmpStr = "quote";
444
 				$tmpStr = "quote";
454
 				break;
454
 				break;
455
 			case "7":
455
 			case "7":
456
 				$tmpStr = "mp3";
456
 				$tmpStr = "mp3";
457
-				break;								
457
+				break;
458
 		}
458
 		}
459
 		return $tmpStr;
459
 		return $tmpStr;
460
 	}
460
 	}
461
-	
461
+
462
 	function type2Number($string) {
462
 	function type2Number($string) {
463
 		$tmpStr = "";
463
 		$tmpStr = "";
464
 		switch ($string) {
464
 		switch ($string) {
466
 				$tmpStr = "1";
466
 				$tmpStr = "1";
467
 				break;
467
 				break;
468
 			case "photo":
468
 			case "photo":
469
-				$tmpStr = "2";							   
469
+				$tmpStr = "2";
470
 				break;
470
 				break;
471
 			case "quote":
471
 			case "quote":
472
 				$tmpStr = "3";
472
 				$tmpStr = "3";
482
 				break;
482
 				break;
483
 			case "mp3":
483
 			case "mp3":
484
 				$tmpStr = "7";
484
 				$tmpStr = "7";
485
-				break;								
485
+				break;
486
 		}
486
 		}
487
 		return $tmpStr;
487
 		return $tmpStr;
488
 	}
488
 	}
489
-	
489
+
490
 	function trimString($string, $len = "") {
490
 	function trimString($string, $len = "") {
491
+		if($len>strlen($string) or $len<1)
492
+			return $string;
491
 		$string = strip_tags($string);
493
 		$string = strip_tags($string);
492
-		$len = (empty($len)) ? "50" : $len ;		
494
+		$len = (empty($len)) ? "50" : $len ;
493
 		return ( strpos($string, " ", $len) ) ? substr_replace($string, "...", $len) : $string ;
495
 		return ( strpos($string, " ", $len) ) ? substr_replace($string, "...", $len) : $string ;
494
 	}
496
 	}
495
 ?>
497
 ?>