Jump to content

Critical - Mixed Slashing In Css Link In Order Form Page


Recommended Posts

Posted

Describe the issue you're experiencing.

 

Order page is totally unusable in Firefox (see the screenshot below). It works in Chrome due to its feature.

The HTML code of the page contains

 

 

 

<link href="/plugins\order\views/templates\standard/css/order.css" rel="stylesheet" type="text/css" />

which is invalid (the fact that Chrome is able to handle it does not make it valid, this is bug in Blesta, not Firefox).

 

This is generated from plugins\order\controllers\main.php line 83:

 

           

 

"<link href=\"" . Router::makeURI(str_replace("index.php/", "", WEBDIR)) . $this->view->view_path . "views/" . $this->view->view . "/css/order.css\" rel=\"stylesheet\" type=\"text/css\" />"

where probably those $this->view things have Windows slashing.

 

 

 

Provide detailed steps necessary to reproduce the issue.

 

We believe that it is enough to use Firefox to access Blesta installed on Windows server, which seems that no one ever done before! :(

Have anyone ever tested Blesta installation on Windows?

 

List any generated errors. (The "Oh Noes" error pages are very helpful.)

 

N/A

 

Include the URL the error occurred on, relative to the installation path, ie "/admin/login".

 

/plugin/order/main/index/ORDERFORMNAME

 

Attach screenshots.

 

 

ChFf4ic.jpg

 

Include your configuration settings, i.e. OS, version of Blesta, PHP & MySQL.

 

Server: Blesta 3.0.3 on Windows Server 2008 R2

Client: Firefox 24.0

Posted

CubicWebs: Thank you for your response. Could you confirm that your Blesta runs on Windows Server, because this is what we believe is the cause?

Posted

This looks like a bug with the order plugin. Try editing line 83 of /plugins/order/controllers/main.php.

 

From:

 

            "<link href=\"" . Router::makeURI(str_replace("index.php/", "", WEBDIR)) . $this->view->view_path . "views/" . $this->view->view . "/css/order.css\" rel=\"stylesheet\" type=\"text/css\" />"

 

 

To:

 

            "<link href=\"" . Router::makeURI(str_replace("index.php/", "", WEBDIR) . $this->view->view_path) . "views/" . $this->view->view . "/css/order.css\" rel=\"stylesheet\" type=\"text/css\" />"
Posted

The result now is that the HTML page contains:

 

		<link href="/plugins/order/views/templates\standard/css/order.css" rel="stylesheet" type="text/css" />    </head>

 

Please compare with the original state:

 

<link href="/plugins\order\views/templates\standard/css/order.css" rel="stylesheet" type="text/css" />

 

You can clearly see, the new result IS BETTER, but not fixed - Firefox still displays the page poorly. Invalid slashing is still there in the "$this->view->view".

 

This leads us to a final solution - moving that closing bracket even further to the left. From your suggested code:

 

"<link href=\"" . Router::makeURI(str_replace("index.php/", "", WEBDIR) . $this->view->view_path) . "views/" . $this->view->view . "/css/order.css\" rel=\"stylesheet\" type=\"text/css\" />"

 

to final version:

 

"<link href=\"" . Router::makeURI(str_replace("index.php/", "", WEBDIR) . $this->view->view_path . "views/" . $this->view->view) . "/css/order.css\" rel=\"stylesheet\" type=\"text/css\" />"

 

This final code generates:

 

		<link href="/plugins/order/views/templates/standard/css/order.css" rel="stylesheet" type="text/css" />    </head>

which is correct.

 

 

 

Cody: Please update your newly suggested code so that the closing bracket is put after $this->view->view instead of just after $this->view->view_path. There were two back slashes in the originally created HTML code, we have to fix both of them.

Guest
This topic is now closed to further replies.
×
×
  • Create New...