File/nasmail/functions/url_parser.php

Description

url_parser.php

This code provides various string manipulation functions that are used by the rest of the SquirrelMail code.

  • version: $Id: url_parser.php 490 2007-07-01 07:25:50Z tokul $
  • copyright: (c) 1999-2006 The SquirrelMail Project Team
  • copyright: (c) 2006-2007 The NaSMail Project
  • license: GNU Public License
Functions
parseEmail (line 52)

Replaces email addresses with NaSMail compose links

  • return: number of unique addresses found
int parseEmail (string &$body)
  • string &$body: body text
parseUrl (line 95)

Converts URLs to html links opened in new window

void parseUrl (string &$body)
  • string &$body: body text
replaceBlock (line 24)

Replaces part of text body with given replacement string

void replaceBlock (string &$in, string $replace, int $start, int $end)
  • string &$in: in parsed text
  • string $replace: replace replacement string
  • int $start: start start of replaced text
  • int $end: end end of replaced text
sq_strpos_8bit (line 179)

Finds first occurrence of 8bit data in the string

Function finds first 8bit symbol or html entity that represents 8bit character. Search start is defined by $offset argument. Search ends at $maxlength position. If $maxlength is not defined or bigger than provided string, search ends when string ends.

Check returned data type in order to avoid confusion between bool(false) (not found) and int(0) (first char in the string).

  • return: first 8bit character position or boolean false
int|bool sq_strpos_8bit (string $haystack, [integer $offset = 0], [integer $maxlength = false])
  • string $haystack: haystack parsed text
  • integer $offset: offset start position
  • integer $maxlength: maxlength end position

Documentation generated on Sun, 22 Nov 2009 17:36:53 +0200 by phpDocumentor 1.4.3