// Rule 1b: Remove superfluous whitespace.
$str = preg_replace("/\s{2,}/", '', $str);
+ if (!$str) {
+ return '';
+ }
+
do {
/* (2) Remove all trailing text of the subject that matches the
* the subj-trailer ABNF, repeat until no more matches are
{
$ret = false;
+ if (!$str) {
+ return $ret;
+ }
+
if ($str[0] == ' ') {
$str = substr($str, 1);
$ret = true;
*/
static final protected function _removeBlobWhenNonempty(&$str)
{
- if (($str[0] == '[') &&
+ if ($str &&
+ ($str[0] == '[') &&
(($i = self::_removeBlob($str, 0)) !== false) &&
($i != strlen($str))) {
$str = substr($str, $i);
* @param boolean $not If true, do a 'NOT' search of the range.
*/
public function dateSearch($month, $day, $year, $range, $header = true,
- $not = false)
+ $not = false)
{
$type = $header ? 'header' : 'internal';
if (!isset($this->_search['date'])) {