Mantis Bugtracker          
testlink.org

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0005209TestLinkNew Featurepublic2012-09-06 19:462014-07-27 10:04
Reportersatishk 
Assigned Tokinow 
PriorityhighSeveritymajorReproducibilityalways
StatusclosedResolutionfixed 
PlatformLinuxOSCentosOS Version6.2
Product Version1.9.4 (2012 Q3 - bug fixing) 
Fixed in Version2.0 (planned) 
Summary0005209: Login.php fails to load on new deployment with SSL enabled (missing function utf8_strtolower())
DescriptionThe login page throws a HTTP 500 error when deploying testlink 194 with SSL enabled. The apache ssl_error_log file has the following exception.

PHP Fatal Error: Call to undefined function utf8_strtolower() in var/www/html/testlink_194_lib/functions/gpc_api.php on line 17.
Steps To Reproduce1) Deploy test link v 194 with ssl enabled
2) Launch the testlink url and complete the installation steps for a new install.
3) Launch the testlink page after the install

Expected:
The login page is displayed

Observed:
The login.php page generates an exception

Note: Commenting the line with reference to utf8_strtolower() does not generate the exception.
TagsNo tags attached.
Database (MySQL,Postgres,etc)MYSQL
BrowserChrome
PHP VersionPHP Version 5.3.3
TestCaseID
QA Team - Task Workflow StatusREADY FOR TESTING
Attached Files? file icon gpc_api.php [^] (14,193 bytes) 2012-09-10 16:06

- Relationships
child of 0005193closedfman Availables hot-fixes for 1.9.4 & How To get full fixed package from gitorious 

-  Notes
(0017418)
kresss (reporter)
2012-09-07 15:32

Same issue here.

RHEL 6.3
PHP 5.3.3
PostgreSQL 8.4.12
(0017419)
kresss (reporter)
2012-09-07 15:34

Workaround by changing the function call.

$ diff ../testlink-1.9.4/lib/functions/gpc_api.php gpc_api.php
17c17
< $g_cookie_secure_flag_enabled = isset( $_SERVER['HTTPS'] ) && ( utf8_strtolower( $_SERVER['HTTPS'] ) != 'off' );
---
> $g_cookie_secure_flag_enabled = isset( $_SERVER['HTTPS'] ) && ( strtolower( $_SERVER['HTTPS'], 'UTF-8') != 'off' );
(0017420)
fman (administrator)
2012-09-07 16:51
edited on: 2012-09-07 16:51

Problem is:
utf8_strtolower() NEEDS the mbstring extension installed.

check that you have mbstring extension installed.

(0017421)
fman (administrator)
2012-09-07 16:52
edited on: 2012-09-07 16:53

Reminder sent to: kinow

You need to write some workaround (seems there are several on the net)

http://www.phpwact.org/php/i18n/charsets [^]

(0017428)
kresss (reporter)
2012-09-10 13:57

Installed mbstring (version 5.3.3-14.el6_3) package on RHEL6.
Reverted back to original code base.
Problem persists.

Not sure where the utf8_strtolower function came from. PHP.net doesn't list it. Maybe someone wrote a wrapper around mb_strtolower?
(0017431)
kinow (reporter)
2012-09-10 15:35

My bad, during the port of Mantis code to TestLink I forgot to include this function, that is called only when the user is using HTTPS. I'll fix that ASAP.
(0017433)
fman (administrator)
2012-09-10 16:00

@kinow Please DO COMMIT on testlink_1_9 and master, NOT ON testlink_194
(0017434)
kinow (reporter)
2012-09-10 16:02

@fman: okay, thanks for the heads up. I'll send the file to the user first, to confirm that my change fixes the issue and works in his environment. I'm just debugging the code and creating a test case in tlqarepo.
(0017435)
kinow (reporter)
2012-09-10 16:09

Hi @satishk, @kresss,

I've uploaded a file with a fix for this issue. Could you guys take a look and report if it works, pleease?

I've replaced the call to the missing function to mb_strtolower, used internally by Mantis.

I've also included a test case in our TestLink test instance, so hopefully this issue won't happen again in the future, I apologize again.

After installing a self signed certificate at my local apache2, and using SSL, the fix seems to work :-)

All the best,
Bruno
(0017436)
kresss (reporter)
2012-09-10 17:34

Worked for me. Thanks for the quick turnaround.

S.
(0017437)
kinow (reporter)
2012-09-10 17:43

Thanks @kresss, I'll commit the code to our source repository. The mb_strtolower is compatible with PHP 4.x & 5.x, so I believe we won't have any other issues with this part of the code.
(0017438)
kinow (reporter)
2012-09-10 17:57

@fman: committed the gpc_api.php file to testlink_1_9 and master (the login.php requires some merging)
(0017453)
satishk (reporter)
2012-09-11 19:51

@kinow - Works for me too. Thanks for the quick fix. Much appreciated.
(0017454)
kinow (reporter)
2012-09-11 19:59

@satishk thank you! I'm setting the issue status to resolved, it will be available in the next release. Thank you all.
(0021341)
fman (administrator)
2014-07-27 10:04

done

- Issue History
Date Modified Username Field Change
2012-09-06 19:46 satishk New Issue
2012-09-07 15:32 kresss Note Added: 0017418
2012-09-07 15:34 kresss Note Added: 0017419
2012-09-07 16:51 fman Note Added: 0017420
2012-09-07 16:51 fman Note Edited: 0017420 View Revisions
2012-09-07 16:52 fman Note Added: 0017421
2012-09-07 16:53 fman Note Edited: 0017421 View Revisions
2012-09-10 13:57 kresss Note Added: 0017428
2012-09-10 14:28 kinow Assigned To => kinow
2012-09-10 14:28 kinow Status new => work in progress
2012-09-10 15:35 kinow Note Added: 0017431
2012-09-10 16:00 fman Note Added: 0017433
2012-09-10 16:02 kinow Note Added: 0017434
2012-09-10 16:06 kinow File Added: gpc_api.php
2012-09-10 16:09 kinow Note Added: 0017435
2012-09-10 17:34 kresss Note Added: 0017436
2012-09-10 17:43 kinow Note Added: 0017437
2012-09-10 17:57 kinow Note Added: 0017438
2012-09-11 19:51 satishk Note Added: 0017453
2012-09-11 19:58 kinow Status work in progress => assigned
2012-09-11 19:59 kinow Task Workflow Status TBD => READY FOR TESTING
2012-09-11 19:59 kinow Note Added: 0017454
2012-09-11 19:59 kinow Status assigned => resolved
2012-09-11 19:59 kinow Fixed in Version => 2.0 Alpha 3
2012-09-11 19:59 kinow Resolution open => fixed
2012-09-12 17:53 fman Fixed in Version 2.0 Alpha 3 => 2.0 (planned)
2012-09-19 06:03 fman Summary Login.php fails to load on new deployment with SSL enabled => Login.php fails to load on new deployment with SSL enabled (missing function utf8_strtolower())
2012-09-19 06:04 fman Relationship added child of 0005193
2014-07-27 10:04 fman Note Added: 0021341
2014-07-27 10:04 fman Status resolved => closed



Copyright © 2000 - 2018 MantisBT Team
Powered by Mantis Bugtracker