Welcome Guest, Not a member yet? Register   Sign In
2 trailing [EDIT:] leading whitespaces in output
#21

[eluser]Dam1an[/eluser]
I can't produce the 'error' either
Have you tried a range of browsers?
#22

[eluser]mradlmaier[/eluser]
Sure, Firefox and Opera, both show the same 2 leading white space in the source. If i open any other pages source, i.e. this page`s, sourc view has no leading white spaces.

Michael
#23

[eluser]Yorick Peterse[/eluser]
Perhaps it's easier to change that third party app instead. It shouldn't be that much of a problem, probably something like this:

Code:
<?php
$var = "Your application's output, the 0 with 2 leading spaces in this case" //fetched by the third party app

//Trim it
$var = trim($var);

//Just in case the trim function didn't work out, probably not even needed
$var = str_replace("  ","",$var); //Remove the 2 leading spaces

//Return it
return $var;


?>
#24

[eluser]mradlmaier[/eluser]
Can`t change the third-party app. It is completely out of my control. That`s why i called it a third-party app. I guess, it would be easy to change, but it is not in my power arrange for that...:-(

Besides that, it would be nice to know, what`s wrong instead of creating some work-around/hack.
I mean, I don`t shit you all with this problem and any unresolved issues will CI look less robust, if you know what I mean. And I am speaking as a CI fan.

Michael
#25

[eluser]Yorick Peterse[/eluser]
[quote author="mradlmaier" date="1241314071"]Can`t change the third-party app. It is completely out of my control. That`s why i called it a third-party app. I guess, it would be easy to change, but it is not in my power arrange for that...:-(

Besides that, it would be nice to know, what`s wrong instead of creating some work-around/hack.
I mean, I don`t shit you all with this problem and any unresolved issues will CI look less robust, if you know what I mean. And I am speaking as a CI fan.

Michael[/quote]

Don't worry, we understand the problem Wink
The thing is though that it seems to be something else as nobody can reproduce the error.
#26

[eluser]Dam1an[/eluser]
For testing sake, lets hack the core (I just want to see if it will work)

open /system/libraries/output.php
Find the _display function
Go to line 351, this is where it echo's the output, therefore sending it to the browser

call trim on the $output before echo'ing it

If that doesn't fix it, then I have no idea whats going on
#27

[eluser]mradlmaier[/eluser]
To fix the problem, without changing the CI app (which might work correctly remotely), I wrote a small cURL "proxy", which will call the CI method and trim the result. And the third-party app will visit the proxy instead of calling into the CI app directly.
At least i have control over the url the third-party app visits.

Anyway, that work-around seems to work, I still like to know where the 2 leading white spaces come from.

Michael
#28

[eluser]mradlmaier[/eluser]
[quote author="Dam1an" date="1241314542"]For testing sake, lets hack the core (I just want to see if it will work)

open /system/libraries/output.php
Find the _display function
Go to line 351, this is where it echo's the output, therefore sending it to the browser

call trim on the $output before echo'ing it

If that doesn't fix it, then I have no idea whats going on[/quote]


Sounds interesting, DamFam.
I will do that tomorrow...
I will post the result...

Michael
#29

[eluser]mradlmaier[/eluser]
[quote author="Dam1an" date="1241314542"]For testing sake, lets hack the core (I just want to see if it will work)

open /system/libraries/output.php
Find the _display function
Go to line 351, this is where it echo's the output, therefore sending it to the browser

call trim on the $output before echo'ing it

If that doesn't fix it, then I have no idea whats going on[/quote]


Just changed it to

Quote:echo trim($output);

Same result, 2 leading white spaces. To make sure i have no browser cache issue, i called into the CI app with a newly opened, third browser (seamonkey) - same problem.
An the other hand my "cURL proxy" correctly trims the 2 leading white spaces... removing the trim() from the cURL proxy causes the 2 leading white spaces show up (as i expected).

Isn`t that really strange?

Michael
#30

[eluser]Dam1an[/eluser]
Very strange... What about calling substring on the output, starting at position 2
(I'm really intrigued as to why its not working)




Theme © iAndrew 2016 - Forum software by © MyBB