Bug #22178

Deprecated function sql_regcase in cms/tslib/class.tslib_pagegen.php

Added by Frank Buijze almost 10 years ago. Updated about 1 year ago.

Status:
Closed
Priority:
Should have
Category:
-
Target version:
-
Start date:
2010-02-24
Due date:
% Done:

0%

TYPO3 Version:
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

The function pagegenInit() in typo3/sysext/cms/tslib/class.tslib_pagegen.php is using the function sql_regcase() which is deprecated in PHP 5.3.

The default front-end search form is using this function. At least if a link in the result set is clicked.

Possible solution:

Add an additional function to replace sql_regcase:

function mb_sql_regcase($string,$encoding='auto'){
$max=mb_strlen($item,$encoding);
for ($i = 0; $i < $max; $i++) {
$char=mb_substr($item,$i,1,$encoding);
$up=mb_strtoupper ($char,$encoding);
$low=mb_strtolower($char,$encoding);
$ret.=($up!=$low)?'['.$up.$low.']' : $char;
}
return $ret;
}
?>

(issue imported from #M13649)

patch_13649_1.diff View (2.28 KB) Administrator Admin, 2010-05-07 17:09

patch_13649_2.diff View (2.27 KB) Administrator Admin, 2010-06-25 13:45


Related issues

Related to TYPO3 Core - Bug #21865: htmlmail: deprecated message with PHP 5.3 for sql_regcase Closed 2009-12-18
Duplicated by TYPO3 Core - Bug #21946: sql_regcase() deprecated with PHP 5.3.1 Closed 2010-01-11

History

#1 Updated by Philipp Gampe almost 10 years ago

I can confirm this problem ...

sr_feuser_register uses this two

#2 Updated by Christian Goudreau over 9 years ago

I can confirm this too...

#3 Updated by Martin over 9 years ago

Hey,
the occurrence of depricated funktion is only on t3lib/class.t3lib_htmlmail.php and typo3/sysext/cms/tslib/class.tslib_pagegen.php

On file class.tslib_pagegen.php it is used for front-end search form only.
The intent is to produce a Regex with case insensitiv characters.

My proposal is to cut off additional functions for that case.
The patch #10231 / Revision 5574 replaced split() to preg_split() on class.tslib_content.php. Now we can use the regex-modifier on regex-pattern to achieve that.

My patch cut off sql_regcase() without adding an additional function.

#4 Updated by Andreas over 9 years ago

what's with that patch? in SVN there is still no sight of that suggested change - so in php 5.3.x this typo3 classes still dont do there work. all the best!

#5 Updated by Chris topher over 9 years ago

Hi Andreas,

you can post a reminder to the thread in Core List. People most likely won't see it here...

#6 Updated by Andreas Lappe over 9 years ago

patch_2 works without offset against 4.4.0...

#7 Updated by Steffen Kamper over 9 years ago

Committed to svn
4_3 rev 8293
4_4 rev 8294
trunk rev 8295

#8 Updated by Benni Mack about 1 year ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF