What does lib/typo3 do??

What does lib/typo3 do??

от Howard Miller -
Количество ответов: 13
Изображение пользователя Core developers Изображение пользователя Documentation writers Изображение пользователя Particularly helpful Moodlers Изображение пользователя Peer reviewers Изображение пользователя Plugin developers
Very recently, quiz import has started throwing

Notice: Undefined index: utf-8 in /srv/www/htdocs/moodle/head/lib/typo3/class.t3lib_cs.php on line 1008

Notice: Uninitialized string offset: 4 in /srv/www/htdocs/moodle/head/lib/typo3/class.t3lib_cs.php on line 1843

...I have been trying to track it down, but this is not called directly by the quiz code. It would be helpful if somebody could give me a clue as to what this code is for and what might be calling it (and even why it is throwing notices).
В ответ на Howard Miller

Re: What does lib/typo3 do??

от Petr Skoda -
Изображение пользователя Core developers Изображение пользователя Documentation writers Изображение пользователя Particularly helpful Moodlers Изображение пользователя Peer reviewers Изображение пользователя Plugin developers
Update from cvs and try again, I have fixed a bug recently in lib/textlib.class.php. You can find more info there подмигиваю
В ответ на Petr Skoda

Re: What does lib/typo3 do??

от Howard Miller -
Изображение пользователя Core developers Изображение пользователя Documentation writers Изображение пользователя Particularly helpful Moodlers Изображение пользователя Peer reviewers Изображение пользователя Plugin developers
nope... no different. I'll try and find out were these routines might be getting called.
В ответ на Howard Miller

Re: What does lib/typo3 do??

от Ger Tielemans -
Is this for unilogin With Typo3? Has someone a manual for this topic?
В ответ на Ger Tielemans

Re: What does lib/typo3 do??

от Martín Langhoff -
No SSO with Typo3 -- not from this library. It is unicode-correct string handling. PHP's native string functions are useless when you are using utf-8.

The Typo3 project tackled the unicode transition a while ago, and wrote a lot of handy code for that. Eloy picked it as the best-of-breed code to use in Moodle. And after a lot of haggling, we got all of it for free! подмигиваю
В ответ на Martín Langhoff

Re: What does lib/typo3 do??

от Howard Miller -
Изображение пользователя Core developers Изображение пользователя Documentation writers Изображение пользователя Particularly helpful Moodlers Изображение пользователя Peer reviewers Изображение пользователя Plugin developers
Ok, so how/where is it used? Do we need to worry about it?
В ответ на Howard Miller

Re: What does lib/typo3 do??

от Martin Dougiamas -
Изображение пользователя Core developers Изображение пользователя Documentation writers Изображение пользователя Moodle HQ Изображение пользователя Particularly helpful Moodlers Изображение пользователя Plugin developers Изображение пользователя Testers
It's used whenever we need to convert non-Unicode text into Unicode, as happens in the Moodle 1.6 migration process (and possibly during quiz import).
В ответ на Martin Dougiamas

Re: What does lib/typo3 do??

от Howard Miller -
Изображение пользователя Core developers Изображение пользователя Documentation writers Изображение пользователя Particularly helpful Moodlers Изображение пользователя Peer reviewers Изображение пользователя Plugin developers

Tracked it down a bit...

It's calling optional_param(...) with $type=PARAM_CLEANFILE.

The code looks like...

  $format = optional_param('format','', PARAM_CLEANFILE );

is this still ok, or has something changed? I did a grep and noted that the quiz import/export seems to be the only place that this clean type is used, so I'm guessing I've been using the wrong one all along грущу

В ответ на Howard Miller

Re: What does lib/typo3 do??

от Petr Skoda -
Изображение пользователя Core developers Изображение пользователя Documentation writers Изображение пользователя Particularly helpful Moodlers Изображение пользователя Peer reviewers Изображение пользователя Plugin developers
clean_filename() uses typo3's unicode conversion.

There might be something wrong with your PHP - what version is it? do you have iconv or mbstring extensions installed?

There might be better parameter types than PARAM_CLEANFILE for this paticular case, but it is secure and should work here. I might replace it later when I get to it.

I can fix the problem quickly only if I can replicate it on my server or when I have ssh/ftp access to your server.

skodak
В ответ на Petr Skoda

Re: What does lib/typo3 do??

от Howard Miller -
Изображение пользователя Core developers Изображение пользователя Documentation writers Изображение пользователя Particularly helpful Moodlers Изображение пользователя Peer reviewers Изображение пользователя Plugin developers
Mmm... I have PHP 4.4.0 on my development server. I have both the iconv and mbstring extensions installed. FWIW, it's a straight SuSE 10.0 install.

I can probably just change the type and/or you can have access to my server if you want to have a closer look. Let me know улыбаюсь

EDIT:
Ok, have changed and submitted to CVS a change from PARAM_CLEANFILE to PARAM_FILE. It clears the problem, but I'm unsure why it didn't work in the first place. I don't know if you want to investigate further.
В ответ на Howard Miller

Re: What does lib/typo3 do??

от Petr Skoda -
Изображение пользователя Core developers Изображение пользователя Documentation writers Изображение пользователя Particularly helpful Moodlers Изображение пользователя Peer reviewers Изображение пользователя Plugin developers
Changing type is not a solution, because the notice will popup whenever you do anything related to uploading of files.

Thanks for the info, I will try it under suse подмигиваю
В ответ на Petr Skoda

Re: What does lib/typo3 do??

от Howard Miller -
Изображение пользователя Core developers Изображение пользователя Documentation writers Изображение пользователя Particularly helpful Moodlers Изображение пользователя Peer reviewers Изображение пользователя Plugin developers
The code is full of PARAM_FILE but (almost) no PARAM_CLEANFILE. Is the intention to change over to the 'new' version?
В ответ на Howard Miller

Re: What does lib/typo3 do??

от Petr Skoda -
Изображение пользователя Core developers Изображение пользователя Documentation writers Изображение пользователя Particularly helpful Moodlers Изображение пользователя Peer reviewers Изображение пользователя Plugin developers
They are different, my intention is to fix all parameters. But I am not sure I will be able to do it in my free time before 1.6 branching грущу