View Issue Details

IDProjectCategoryView StatusLast Update
0012718mantisbthtmlpublic2014-12-08 02:07
ReporterKirill Assigned Todhx  
PrioritynormalSeveritymajorReproducibilityhave not tried
Status closedResolutionfixed 
Product Version1.3.0dev 
Target Version1.3.0-beta.1 
Summary0012718: Error php-parsing in /admin/check/index.php
Description

$php -v
PHP 5.2.10 (cli) (built: Nov 13 2009 11:24:03)
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2009 Zend Technologies

PHP Parse error: syntax error, unexpected T_STRING in /var/www/admin/check/index.php on line 63

Tagspatch
Attached Files
0012718.patch (1,202 bytes)   
From a33ee7538391c90b6527a2c3632a5f42d7214b73 Mon Sep 17 00:00:00 2001
From: Kirill Krasnov <krasnovforum@gmail.com>
Date: Mon, 24 Jan 2011 14:17:57 +0200
Subject: [PATCH] Fix incorrect php parcing with error PHP Parse error:  syntax error, unexpected T_STRING in /admin/check/index.php on line 63

---
 admin/check/index.php |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/admin/check/index.php b/admin/check/index.php
index acc60a8..0e5417b 100644
--- a/admin/check/index.php
+++ b/admin/check/index.php
@@ -59,8 +59,8 @@ $t_show_all_mode_link = '<a href="index.php?show_all=' . ($g_show_all ? '0' : '1
 $t_show_errors_mode_link = '<a href="index.php?show_all=' . ($g_show_all ? '1' : '0') . '&amp;show_errors=' . ($g_show_errors ? '0' : '1') . '">' . ($g_show_errors ? 'Hide verbose error messages' : 'Show verbose error messages') . '</a>';
 
 http_content_headers();
+echo '<?xml version="1.0" encoding="utf-8"?>';
 ?>
-<?xml version="1.0" encoding="utf-8"?>
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
 <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en" >
 <head>
-- 
1.7.3.1.msysgit.0

0012718.patch (1,202 bytes)   
check.patch (781 bytes)   
diff --git a/admin/check/index.php b/admin/check/index.php
index acc60a8..3b66d55 100644
--- a/admin/check/index.php
+++ b/admin/check/index.php
@@ -59,8 +59,9 @@ $t_show_all_mode_link = '<a href="index.php?show_all=' . ($g_show_all ? '0' : '1
 $t_show_errors_mode_link = '<a href="index.php?show_all=' . ($g_show_all ? '1' : '0') . '&amp;show_errors=' . ($g_show_errors ? '0' : '1') . '">' . ($g_show_errors ? 'Hide verbose error messages' : 'Show verbose error messages') . '</a>';
 
 http_content_headers();
+
+header ("Content-Type:text/xml");
 ?>
-<?xml version="1.0" encoding="utf-8"?>
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
 <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en" >
 <head>
check.patch (781 bytes)   

Relationships

related to 0015721 closedgrangeway Functionality to consider porting to master-2.0.x 

Activities

atrol

atrol

2011-01-24 08:34

developer   ~0028048

Reminder sent to: dhx

There are two problems solved with this patch:

  1. XML validation error when using browsers which validate application/xhtml+xml
  2. Syntax error when using PHP with setting short_open_tag = On
    I got this when playing with latest Beta auf XAMPP
    David, what do you think: Should we allow short_open_tag = On or not?
    If no, you should add this to your checks.
Want

Want

2011-01-31 11:36

reporter   ~0028122

Why write into code XML header as string? Sending headers info is better. See attached check.patch.

dhx

dhx

2011-02-28 05:20

reporter   ~0028314

Thanks Kirill and atrol. I've applied the fix.

@atrol: I think we should continue to allow short_tag_open unless it is going to cause problems later on.

@Want: http_content_headers() already sends the correct Content-Type header depending on what the user's browser supports.

grangeway

grangeway

2013-04-05 17:57

reporter   ~0036465

Marking as 'acknowledged' not resolved/closed to track that change gets ported to master-2.0.x branch