Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2010-11-27 23:48:05

gomedia
Plugin Author
Registered: 2008-06-01
Posts: 1,373

Warning: str_repeat() expects parameter 2 to be long

I’ve upgraded my local development environment to PHP 5.3.1 with MySQL 5.1.52 and I’m seeing the following messages:

Warning: str_repeat() expects parameter 2 to be long, string given in /Users/adi/Sites/colacgolfclub/textpattern/lib/txplib_misc.php on line 1948 Warning: str_repeat() expects parameter 2 to be long, string given in /Users/adi/Sites/colacgolfclub/textpattern/lib/txplib_misc.php on line 1948
A problem occured while loading the plugin: adi_menu -> Warning: str_repeat() expects parameter 2 to be long, string given on line 1948
textpattern/lib/txplib_misc.php:1948 str_repeat()
textpattern/lib/txplib_db.php:85 trace_add()
textpattern/lib/txplib_db.php:258 safe_query()
textpattern/lib/txplib_db.php:197 getRow()
textpattern/lib/txplib_misc.php(570) : eval()'d code:78 safe_row()
textpattern/lib/txplib_misc.php:570 eval()
textpattern/publish.php:114 load_plugins()
index.php:32 include()
A problem occured while loading the plugin: adi_menu -> Warning: str_repeat() expects parameter 2 to be long, string given on line 1948
textpattern/lib/txplib_misc.php:1948 str_repeat()
textpattern/lib/txplib_db.php:85 trace_add()
textpattern/lib/txplib_db.php:258 safe_query()
textpattern/lib/txplib_db.php:197 getRow()
textpattern/lib/txplib_misc.php(570) : eval()'d code:79 safe_row()
textpattern/lib/txplib_misc.php:570 eval()
textpattern/publish.php:114 load_plugins()
index.php:32 include()
Warning: str_repeat() expects parameter 2 to be long, string given in /Users/adi/Sites/colacgolfclub/textpattern/lib/txplib_misc.php on line 1948 Warning: str_repeat() expects parameter 2 to be long, string given in /Users/adi/Sites/colacgolfclub/textpattern/lib/txplib_misc.php on line 1948 Warning: str_repeat() expects parameter 2 to be long, string given in /Users/adi/Sites/colacgolfclub/textpattern/lib/txplib_misc.php on line 1948
Tag error:  <txp:output_form form="page_top" /> ->  Warning: str_repeat() expects parameter 2 to be long, string given  on line 1948
textpattern/lib/txplib_misc.php:1948 str_repeat()
textpattern/publish.php:1074 trace_add()
textpattern/publish.php:1012 processTags()
textpattern/publish.php:496 parse()
index.php:33 textpattern()
Warning: str_repeat() expects parameter 2 to be long, string given in /Users/adi/Sites/colacgolfclub/textpattern/lib/txplib_misc.php on line 1948

TXP version is 4.0.8 – the same site on a server running PHP 5.2.11 & MySQL 5.0.91 shows no errors.

Any thoughts?

Offline

#2 2010-11-28 02:30:46

jsoo
Plugin Author
From: NC, USA
Registered: 2004-11-15
Posts: 1,793
Website

Re: Warning: str_repeat() expects parameter 2 to be long

Does adi_menu use str_repeat()? Does it ever feed that function a value, say from a tag attribute, that could be a numeric string?


Code is topiary

Offline

#3 2010-11-28 02:49:56

gomedia
Plugin Author
Registered: 2008-06-01
Posts: 1,373

Re: Warning: str_repeat() expects parameter 2 to be long

Hi Jeff,

Thanks for the reply.

jsoo wrote:

Does adi_menu use str_repeat()? Does it ever feed that function a value, say from a tag attribute, that could be a numeric string?

No, adi_menu doesn’t use str_repeat().

I’m hoping that it’s something to do with the (old) version of TXP running in conjunction with PHP 5.3 or MySQL 5.1. I need to upgrade TXP from 4.0.8 anyway, so I’ll see what happens then.

Offline

#4 2010-11-28 14:14:19

jsoo
Plugin Author
From: NC, USA
Registered: 2004-11-15
Posts: 1,793
Website

Re: Warning: str_repeat() expects parameter 2 to be long

Ah, careless of me — I was looking at 4.3.0. Line 1948 of txplib_misc.php does indeed use str_repeat(), using the global $txptracelevel as the second argument. You are upgrading so I think this will go away — from a quick check I see that in 4.0.8 $txptracelevel is initialized as an empty string; in 4.3.0 it is initialized to 0.


Code is topiary

Offline

#5 2010-12-04 09:35:56

gomedia
Plugin Author
Registered: 2008-06-01
Posts: 1,373

Re: Warning: str_repeat() expects parameter 2 to be long

And to confirm – an upgrade to 4.3.0 sorted out all the error messages.

Offline

#6 2011-02-28 22:30:25

gomedia
Plugin Author
Registered: 2008-06-01
Posts: 1,373

Re: Warning: str_repeat() expects parameter 2 to be long

For the record, errors seen in TXP 4.0.7 as well.

Offline

Board footer

Powered by FluxBB