Bug #3568

PHP version check comes too late on non-namespaced PHP versions

Added by Karsten Dambekalns over 12 years ago. Updated about 11 years ago.

Status:
Resolved
Priority:
Should have
Category:
-
Start date:
2009-06-04
Due date:
% Done:

100%

Estimated time:
PHP Version:
Has patch:
Complexity:

Description

Using FLOW3 on PHP < 5.3 ends with a fatal error about an illegal input character (backspace). There is a version check in FLOW3.php, but it comes too late: The parsing is done before any execution, so the backslash in Public/index.php causes a fatal error (as would any backslashes in FLOW3.php).

#1

Updated by Tim Eilers over 12 years ago

What about adding this after "BOOTSTRAPDEV"?

PHPCHECK=$($PHP -v | head -n 1)
if [ ${PHPCHECK:4:1} -lt 5 -o ${PHPCHECK:4:1} -eq 5 -a ${PHPCHECK:6:1} -lt 3 ]; then
        echo 'FLOW3 requires at least PHP 5.3'
        exit 1
fi
#2

Updated by Robert Lemke over 12 years ago

  • Target version set to 1.0 alpha 2
#3

Updated by Robert Lemke over 12 years ago

  • Status changed from New to Resolved
  • % Done changed from 0 to 100

Applied in changeset r2655.

#4

Updated by Karsten Dambekalns over 12 years ago

  • Status changed from Resolved to Accepted
  • Assignee set to Robert Lemke
  • % Done changed from 100 to 0

The parsing is done before the execution... See:

kmac:Public karsten$ /usr/bin/php -v
PHP 5.2.8 (cli) (built: Feb 6 2009 12:33:08)
Copyright (c) 1997-2008 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2008 Zend Technologies
kmac:Public karsten$ /usr/bin/php ~/Sites/flow3/Public/index.php

Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /Users/karsten/Sites/flow3/Public/index.php on line 40

Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /Users/karsten/Sites/flow3/Public/index.php on line 40

Parse error: syntax error, unexpected T_STRING in /Users/karsten/Sites/flow3/Public/index.php on line 40
kmac:Public karsten$

#5

Updated by Karsten Dambekalns over 12 years ago

  • Assignee changed from Robert Lemke to Karsten Dambekalns
#6

Updated by Karsten Dambekalns over 12 years ago

  • Status changed from Accepted to Resolved
  • % Done changed from 0 to 100

Applied in changeset r2668.

Also available in: Atom PDF