Various PHP5 fixes + updates to Danish backend translation
authorKasper Skårhøj <kasper@typo3.org>
Sun, 5 Sep 2004 22:30:50 +0000 (22:30 +0000)
committerKasper Skårhøj <kasper@typo3.org>
Sun, 5 Sep 2004 22:30:50 +0000 (22:30 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@453 709f56b5-9817-0410-a4d7-c38de5d9e867

t3lib/class.t3lib_beuserauth.php
t3lib/class.t3lib_cs.php
t3lib/class.t3lib_div.php
typo3/sysext/cms/web_info/locallang.xml
typo3/sysext/lang/locallang_alt_doc.xml
typo3/sysext/lang/locallang_core.xml
typo3/sysext/lang/locallang_general.xml
typo3/sysext/lang/locallang_mod_web_perm.xml
typo3/sysext/lang/locallang_show_rechis.xml
typo3/sysext/lang/locallang_tca.xml
typo3/sysext/setup/mod/locallang.xml

index e08f80c..a7b4e20 100644 (file)
@@ -238,6 +238,7 @@ class t3lib_beUserAuth extends t3lib_userAuthGroup {
         * @internal
         */
        function backendSetUC() {
+
                        // UC - user configuration is a serialized array inside the userobject
                $temp_theSavedUC=unserialize($this->user['uc']);                // if there is a saved uc we implement that instead of the default one.
                if (is_array($temp_theSavedUC)) {
@@ -245,7 +246,7 @@ class t3lib_beUserAuth extends t3lib_userAuthGroup {
                }
                        // Setting defaults if uc is empty
                if (!is_array($this->uc))       {
-                       $this->uc = array_merge($this->uc_default,$TYPO3_CONF_VARS['BE']['defaultUC'],$this->getTSConfigProp('setup.default')); // Candidate for t3lib_div::array_merge() if integer-keys will some day make trouble...
+                       $this->uc = array_merge($this->uc_default, (array)$TYPO3_CONF_VARS['BE']['defaultUC'], (array)$this->getTSConfigProp('setup.default')); // Candidate for t3lib_div::array_merge() if integer-keys will some day make trouble...
                        $this->overrideUC();
                        $U=1;
                }
@@ -273,7 +274,7 @@ class t3lib_beUserAuth extends t3lib_userAuthGroup {
         * @internal
         */
        function overrideUC()   {
-               $this->uc = array_merge($this->uc,$this->getTSConfigProp('setup.override'));    // Candidate for t3lib_div::array_merge() if integer-keys will some day make trouble...
+               $this->uc = array_merge((array)$this->uc, (array)$this->getTSConfigProp('setup.override'));     // Candidate for t3lib_div::array_merge() if integer-keys will some day make trouble...
        }
 
        /**
index 2a1283b..2a4af73 100755 (executable)
@@ -1365,11 +1365,12 @@ class t3lib_cs {
                        return $string;
                } else  {
                        if ($len > 0)   {
-                               if (isset($string{$i})) {
+                               if (strlen($string{$i}))        {
                                        return substr($string,0,$i).$crop;
+
                                }
                        } else {
-                               if (isset($string{$i-1}))       {
+                               if (strlen($string{$i-1}))      {
                                        return $crop.substr($string,$i);
                                }
                        }
@@ -1515,7 +1516,7 @@ class t3lib_cs {
                }
 
                $out = '';
-               for($i=0; isset($str{$i}); $i++)        {
+               for($i=0; strlen($str{$i}); $i++)       {
                        $c = $str{$i};
                        if (isset($map[$c]))    {
                                $out .= $map[$c];
@@ -1588,7 +1589,7 @@ class t3lib_cs {
         */
        function utf8_strlen($str)      {
                $n=0;
-               for($i=0; isset($str{$i}); $i++)        {
+               for($i=0; strlen($str{$i}); $i++)       {
                        $c = ord($str{$i});
                        if (!($c & 0x80))       // single-byte (0xxxxxx)
                                $n++;
@@ -1684,14 +1685,14 @@ class t3lib_cs {
                        $d = -1;
                }
 
-               for( ; isset($str{$i}) && $n<$p; $i+=$d)        {
+               for( ; strlen($str{$i}) && $n<$p; $i+=$d)       {
                        $c = (int)ord($str{$i});
                        if (!($c & 0x80))       // single-byte (0xxxxxx)
                                $n++;
                        elseif (($c & 0xC0) == 0xC0)    // multi-byte starting byte (11xxxxxx)
                                $n++;
                }
-               if (!isset($str{$i}))   return false; // offset beyond string length
+               if (!strlen($str{$i}))  return false; // offset beyond string length
 
                if ($pos >= 0)  {
                                // skip trailing multi-byte data bytes
@@ -1722,7 +1723,7 @@ class t3lib_cs {
                        elseif (($c & 0xC0) == 0xC0)    // multi-byte starting byte (11xxxxxx)
                                $n++;
                }
-               if (!isset($str{$i}))   return false; // offset beyond string length
+               if (!strlen($str{$i}))  return false; // offset beyond string length
 
                return $n;
        }
@@ -1753,7 +1754,7 @@ class t3lib_cs {
                                return $str;
                }
 
-               for($i=0; isset($str{$i}); $i++)        {
+               for($i=0; strlen($str{$i}); $i++)       {
                        $c = ord($str{$i});
                        if (!($c & 0x80))       // single-byte (0xxxxxx)
                                $mbc = $str{$i};
@@ -1814,7 +1815,7 @@ class t3lib_cs {
         */
        function euc_strtrunc($str,$len,$charset)        {
                $sjis = ($charset == 'shift_jis');
-               for ($i=0; isset($str{$i}) && $i<$len; $i++) {
+               for ($i=0; strlen($str{$i}) && $i<$len; $i++) {
                        $c = ord($str{$i});
                        if ($sjis)      {
                                if (($c >= 0x80 && $c < 0xA0) || ($c >= 0xE0))  $i++;   // advance a double-byte char
@@ -1823,7 +1824,7 @@ class t3lib_cs {
                                if ($c >= 0x80) $i++;   // advance a double-byte char
                        }
                }
-               if (!isset($str{$i}))   return $str;    // string shorter than supplied length
+               if (!strlen($str{$i}))  return $str;    // string shorter than supplied length
 
                if ($i>$len)
                        return substr($str,0,$len-1);   // we ended on a first byte
@@ -1869,7 +1870,7 @@ class t3lib_cs {
        function euc_strlen($str,$charset)       {
                $sjis = ($charset == 'shift_jis');
                $n=0;
-               for ($i=0; isset($str{$i}); $i++) {
+               for ($i=0; strlen($str{$i}); $i++) {
                        $c = ord($str{$i});
                        if ($sjis)      {
                                if (($c >= 0x80 && $c < 0xA0) || ($c >= 0xE0))  $i++;   // advance a double-byte char
@@ -1906,7 +1907,7 @@ class t3lib_cs {
                        $d = -1;
                }
 
-               for ( ; isset($str{$i}) && $n<$p; $i+=$d) {
+               for ( ; strlen($str{$i}) && $n<$p; $i+=$d) {
                        $c = ord($str{$i});
                        if ($sjis)      {
                                if (($c >= 0x80 && $c < 0xA0) || ($c >= 0xE0))  $i+=$d; // advance a double-byte char
@@ -1917,7 +1918,7 @@ class t3lib_cs {
 
                        $n++;
                }
-               if (!isset($str{$i}))   return false; // offset beyond string length
+               if (!strlen($str{$i}))  return false; // offset beyond string length
 
                if ($pos < 0)   $i++;   // correct offset
 
@@ -1952,7 +1953,7 @@ class t3lib_cs {
 
                $sjis = ($charset == 'shift_jis');
                $out = '';
-               for($i=0; isset($str{$i}); $i++)        {
+               for($i=0; strlen($str{$i}); $i++)       {
                        $mbc = $str{$i};
                        $c = ord($mbc);
 
index 8d4ccd4..651cd04 100755 (executable)
@@ -1826,6 +1826,7 @@ class t3lib_div {
         * @see array2xml()
         */
        function xml2array($string,$NSprefix='') {
+               global $TYPO3_CONF_VARS;
 
                        // Create parser:
                $parser = xml_parser_create();
@@ -1834,6 +1835,19 @@ class t3lib_div {
 
                xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, 0);
                xml_parser_set_option($parser, XML_OPTION_SKIP_WHITE, 0);
+
+                       // PHP5 fix of charset awareness:
+                       // Problem is: PHP5 apparently detects the charset of the XML file (or defaults to utf-8) and will AUTOMATICALLY convert the content to either utf-8, iso-8859-1 or us-ascii. PHP4 just passed the content through without taking action regarding the charset.
+                       // In TYPO3 we expect that the charset of XML content is NOT handled in the parser but internally in TYPO3 instead. THerefore it would be very nice if PHP5 could be configured to NOT process the charset of the files. But this is not possible for now.
+                       // What we do here fixes the problem but ONLY if the charset is utf-8, iso-8859-1 or us-ascii. That should work for most TYPO3 installations, in particular if people use utf-8 which we highly recommend.
+               if ((double)phpversion()>=5)    {
+                       unset($ereg_result);
+                       ereg('^[[:space:]]*<\?xml[^>]*encoding[[:space:]]*=[[:space:]]*"([^"]*)"',substr($string,0,200),$ereg_result);
+                       $theCharset = $ereg_result[1] ? $ereg_result[1] : ($TYPO3_CONF_VARS['BE']['forceCharset'] ? $TYPO3_CONF_VARS['BE']['forceCharset'] : 'iso-8859-1');
+                       xml_parser_set_option($parser, XML_OPTION_TARGET_ENCODING, $theCharset);  // us-ascii / utf-8 / iso-8859-1
+               }
+
+                       // Parse content:
                xml_parse_into_struct($parser, $string, $vals, $index);
 
                        // If error, return error message:
index 14fa8b5..1a475f5 100755 (executable)
@@ -64,6 +64,7 @@
                        <label index="lang_renderl10n_page">Side</label>
                        <label index="lang_renderl10n_default">Standard</label>
                        <label index="lang_getlangsta_createNewTranslationHeaders">Opret nye sproghoveder</label>
+                       <label index="lang_renderl10n_CEcount">Optælling af Indholdselementer</label>
                </languageKey>
                <languageKey index="de" type="array">
                        <label index="page_title">Seitenbaum-Übersicht</label>
                        <label index="lang_renderl10n_default" type="integer">128029197</label>
                        <label index="lang_getlangsta_createNewTranslationHeaders" type="integer">193499435</label>
                        <label index="lang_renderl10n_badThingThereAre" type="integer">258445119</label>
+                       <label index="lang_renderl10n_CEcount" type="integer">196252064</label>
                </languageKey>
                <languageKey index="de" type="array">
                        <label index="page_title" type="integer">46867233</label>
index b244037..8c14935 100755 (executable)
                        <label index="noDocuments_listmodule" type="integer">97512249</label>
                </languageKey>
        </orig_hash>
-       <orig_text type="array">
-               <languageKey index="default" type="array">
-               </languageKey>
-               <languageKey index="dk" type="array">
-               </languageKey>
-               <languageKey index="de" type="array">
-               </languageKey>
-               <languageKey index="no" type="array">
-               </languageKey>
-               <languageKey index="it" type="array">
-               </languageKey>
-               <languageKey index="fr" type="array">
-               </languageKey>
-               <languageKey index="es" type="array">
-               </languageKey>
-               <languageKey index="nl" type="array">
-               </languageKey>
-               <languageKey index="cz" type="array">
-               </languageKey>
-               <languageKey index="pl" type="array">
-               </languageKey>
-               <languageKey index="si" type="array">
-               </languageKey>
-               <languageKey index="fi" type="array">
-               </languageKey>
-               <languageKey index="tr" type="array">
-               </languageKey>
-               <languageKey index="se" type="array">
-               </languageKey>
-               <languageKey index="pt" type="array">
-               </languageKey>
-               <languageKey index="ru" type="array">
-               </languageKey>
-               <languageKey index="ro" type="array">
-               </languageKey>
-               <languageKey index="ch" type="array">
-               </languageKey>
-               <languageKey index="sk" type="array">
-               </languageKey>
-               <languageKey index="lt" type="array">
-               </languageKey>
-               <languageKey index="is" type="array">
-               </languageKey>
-               <languageKey index="hr" type="array">
-               </languageKey>
-               <languageKey index="hu" type="array">
-               </languageKey>
-               <languageKey index="gl" type="array">
-               </languageKey>
-               <languageKey index="th" type="array">
-               </languageKey>
-               <languageKey index="gr" type="array">
-               </languageKey>
-               <languageKey index="hk" type="array">
-               </languageKey>
-               <languageKey index="eu" type="array">
-               </languageKey>
-               <languageKey index="bg" type="array">
-               </languageKey>
-               <languageKey index="br" type="array">
-               </languageKey>
-               <languageKey index="et" type="array">
-               </languageKey>
-               <languageKey index="ar" type="array">
-               </languageKey>
-               <languageKey index="he" type="array">
-               </languageKey>
-               <languageKey index="ua" type="array">
-               </languageKey>
-               <languageKey index="lv" type="array">
-               </languageKey>
-               <languageKey index="jp" type="array">
-               </languageKey>
-               <languageKey index="vn" type="array">
-               </languageKey>
-       </orig_text>
 </T3locallang>
\ No newline at end of file
index 9753f61..de668e5 100755 (executable)
@@ -217,6 +217,7 @@ Felterne er markeret med et gult udråbstegn.</label>
                        <label index="labels.depth_3">3 niveauer</label>
                        <label index="labels.allow">Tillad</label>
                        <label index="labels.deny">Afvis</label>
+                       <label index="labels.generalTab">Generelt</label>
                        <label index="labels.refresh">Genindlæs træet fra serveren</label>
                        <label index="labels.temporaryDBmount">Afbryd midlertidigt DB mount</label>
                        <label index="labels.refreshList">Genindlæs liste fra serveren</label>
@@ -241,6 +242,13 @@ Felterne er markeret med et gult udråbstegn.</label>
                        <label index="labels.removeItem">Fjern emne</label>
                        <label index="labels.holdDownCTRL">Vigtigt: Hold CTRL tasten nede mens du vælger elementer fra denne liste!</label>
                        <label index="labels.revertSelection">Bring valgte elementer tilbage</label>
+                       <label index="labels.setAllCheckboxes">Vælg alle checkboxe</label>
+                       <label index="labels.changeInOrig">Ændring i originalen</label>
+                       <label index="ver.online">ONLINE</label>
+                       <label index="ver.mgm">Versionsstyring</label>
+                       <label index="ver.selVer">Vælg version:</label>
+                       <label index="ver.swap">Skift/Udgiv</label>
+                       <label index="ver.swapPage">Udgiv denne version af siden inklusiv indhold</label>
                        <label index="TYPO3_Element_Browser">TYPO3 Element Finder</label>
                        <label index="show_item.php.viewItem">Vis emner</label>
                        <label index="show_item.php.file">Fil</label>
@@ -4291,6 +4299,14 @@ Kas soovite praegu salvestada, et uuendada kuvand?</label>
                        <label index="labels.deny" type="integer">57158934</label>
                        <label index="labels.holdDownCTRL" type="integer">246729511</label>
                        <label index="labels.revertSelection" type="integer">137669033</label>
+                       <label index="labels.generalTab" type="integer">14366585</label>
+                       <label index="labels.setAllCheckboxes" type="integer">249015448</label>
+                       <label index="labels.changeInOrig" type="integer">207166982</label>
+                       <label index="ver.online" type="integer">141368811</label>
+                       <label index="ver.mgm" type="integer">75564445</label>
+                       <label index="ver.selVer" type="integer">141725286</label>
+                       <label index="ver.swap" type="integer">60665691</label>
+                       <label index="ver.swapPage" type="integer">206706262</label>
                </languageKey>
                <languageKey index="de" type="array">
                        <label index="labels.openInNewWindow" type="integer">43359464</label>
index 26afa80..ed92d2f 100755 (executable)
                        <label index="LGL.recursive">Rekursivt:</label>
                        <label index="LGL.l18n_parent">Overs.Orig:</label>
                        <label index="LGL.allLanguages">[Alle]</label>
+                       <label index="LGL.versionLabel">Versioneringstitel:</label>
                </languageKey>
                <languageKey index="de" type="array">
                        <label index="LGL.endtime">Stop:</label>
                        <label index="LGL.recursive" type="integer">152463034</label>
                        <label index="LGL.l18n_parent" type="integer">166415577</label>
                        <label index="LGL.allLanguages" type="integer">24137953</label>
+                       <label index="LGL.versionLabel" type="integer">210163440</label>
                </languageKey>
                <languageKey index="de" type="array">
                        <label index="LGL.endtime" type="integer">167679436</label>
index 2c78f68..c2ef2a4 100755 (executable)
@@ -51,6 +51,8 @@
                        <label index="Owner">Ejer</label>
                        <label index="Group">Gruppe</label>
                        <label index="Everybody">Alle</label>
+                       <label index="EditLock">Lås</label>
+                       <label index="EditLock_descr">Siden og alt indhold er låst for redigering af ikke-admin brugere.</label>
                        <label index="Save">Gem</label>
                        <label index="Abort">Annuller</label>
                        <label index="Edit">REDIGER</label>
                        <label index="mlang_labels_tablabel" type="integer">237456773</label>
                        <label index="mlang_labels_tabdescr" type="integer">115809010</label>
                        <label index="mlang_tabs_tab" type="integer">200750040</label>
+                       <label index="EditLock" type="integer">189288807</label>
+                       <label index="EditLock_descr" type="integer">122566549</label>
                </languageKey>
                <languageKey index="de" type="array">
                        <label index="permissions" type="integer">218680565</label>
                <languageKey index="vn" type="array">
                </languageKey>
        </orig_hash>
-       <orig_text type="array">
-               <languageKey index="default" type="array">
-               </languageKey>
-               <languageKey index="dk" type="array">
-               </languageKey>
-               <languageKey index="de" type="array">
-               </languageKey>
-               <languageKey index="no" type="array">
-               </languageKey>
-               <languageKey index="it" type="array">
-               </languageKey>
-               <languageKey index="fr" type="array">
-               </languageKey>
-               <languageKey index="es" type="array">
-               </languageKey>
-               <languageKey index="nl" type="array">
-               </languageKey>
-               <languageKey index="cz" type="array">
-               </languageKey>
-               <languageKey index="pl" type="array">
-               </languageKey>
-               <languageKey index="si" type="array">
-               </languageKey>
-               <languageKey index="fi" type="array">
-               </languageKey>
-               <languageKey index="tr" type="array">
-               </languageKey>
-               <languageKey index="se" type="array">
-               </languageKey>
-               <languageKey index="pt" type="array">
-               </languageKey>
-               <languageKey index="ru" type="array">
-               </languageKey>
-               <languageKey index="ro" type="array">
-               </languageKey>
-               <languageKey index="ch" type="array">
-               </languageKey>
-               <languageKey index="sk" type="array">
-               </languageKey>
-               <languageKey index="lt" type="array">
-               </languageKey>
-               <languageKey index="is" type="array">
-               </languageKey>
-               <languageKey index="hr" type="array">
-               </languageKey>
-               <languageKey index="hu" type="array">
-               </languageKey>
-               <languageKey index="gl" type="array">
-               </languageKey>
-               <languageKey index="th" type="array">
-               </languageKey>
-               <languageKey index="gr" type="array">
-               </languageKey>
-               <languageKey index="hk" type="array">
-               </languageKey>
-               <languageKey index="eu" type="array">
-               </languageKey>
-               <languageKey index="bg" type="array">
-               </languageKey>
-               <languageKey index="br" type="array">
-               </languageKey>
-               <languageKey index="et" type="array">
-               </languageKey>
-               <languageKey index="ar" type="array">
-               </languageKey>
-               <languageKey index="he" type="array">
-               </languageKey>
-               <languageKey index="ua" type="array">
-               </languageKey>
-               <languageKey index="lv" type="array">
-               </languageKey>
-               <languageKey index="jp" type="array">
-               </languageKey>
-               <languageKey index="vn" type="array">
-               </languageKey>
-       </orig_text>
 </T3locallang>
\ No newline at end of file
index 29c8284..f07f1bc 100755 (executable)
                <languageKey index="vn" type="array">
                </languageKey>
        </orig_hash>
-       <orig_text type="array">
-               <languageKey index="default" type="array">
-               </languageKey>
-               <languageKey index="dk" type="array">
-               </languageKey>
-               <languageKey index="de" type="array">
-               </languageKey>
-               <languageKey index="no" type="array">
-               </languageKey>
-               <languageKey index="it" type="array">
-               </languageKey>
-               <languageKey index="fr" type="array">
-               </languageKey>
-               <languageKey index="es" type="array">
-               </languageKey>
-               <languageKey index="nl" type="array">
-               </languageKey>
-               <languageKey index="cz" type="array">
-               </languageKey>
-               <languageKey index="pl" type="array">
-               </languageKey>
-               <languageKey index="si" type="array">
-               </languageKey>
-               <languageKey index="fi" type="array">
-               </languageKey>
-               <languageKey index="tr" type="array">
-               </languageKey>
-               <languageKey index="se" type="array">
-               </languageKey>
-               <languageKey index="pt" type="array">
-               </languageKey>
-               <languageKey index="ru" type="array">
-               </languageKey>
-               <languageKey index="ro" type="array">
-               </languageKey>
-               <languageKey index="ch" type="array">
-               </languageKey>
-               <languageKey index="sk" type="array">
-               </languageKey>
-               <languageKey index="lt" type="array">
-               </languageKey>
-               <languageKey index="is" type="array">
-               </languageKey>
-               <languageKey index="hr" type="array">
-               </languageKey>
-               <languageKey index="hu" type="array">
-               </languageKey>
-               <languageKey index="gl" type="array">
-               </languageKey>
-               <languageKey index="th" type="array">
-               </languageKey>
-               <languageKey index="gr" type="array">
-               </languageKey>
-               <languageKey index="hk" type="array">
-               </languageKey>
-               <languageKey index="eu" type="array">
-               </languageKey>
-               <languageKey index="bg" type="array">
-               </languageKey>
-               <languageKey index="br" type="array">
-               </languageKey>
-               <languageKey index="et" type="array">
-               </languageKey>
-               <languageKey index="ar" type="array">
-               </languageKey>
-               <languageKey index="he" type="array">
-               </languageKey>
-               <languageKey index="ua" type="array">
-               </languageKey>
-               <languageKey index="lv" type="array">
-               </languageKey>
-               <languageKey index="jp" type="array">
-               </languageKey>
-               <languageKey index="vn" type="array">
-               </languageKey>
-       </orig_text>
 </T3locallang>
\ No newline at end of file
index 974296a..c3b1cfb 100755 (executable)
@@ -40,6 +40,7 @@
                        <label index="sys_language">Website sprog</label>
                        <label index="sys_language.isocode">Vælg officielt sprog (ISO kode):</label>
                        <label index="sys_language.flag">Vælg flagikon:</label>
+                       <label index="editlock">Afvis redigering af ikke-admin brugere:</label>
                </languageKey>
                <languageKey index="de" type="array">
                        <label index="pages">Seite</label>
                        <label index="sys_language" type="integer">144875845</label>
                        <label index="sys_language.isocode" type="integer">49440593</label>
                        <label index="sys_language.flag" type="integer">145114393</label>
+                       <label index="editlock" type="integer">177820058</label>
                </languageKey>
                <languageKey index="de" type="array">
                        <label index="pages" type="integer">26464201</label>
index b1326d5..c537bfa 100755 (executable)
                        <label index="lang_lv">Lettisk</label>
                        <label index="lang_jp">Japansk</label>
                        <label index="lang_vn">Vietnamesisk</label>
+                       <label index="lang_ca">Katalansk</label>
+                       <label index="lang_ba">Bosnisk</label>
+                       <label index="lang_kr">Koreansk</label>
                        <label index="default">Standard</label>
                        <label index="simulate">Simulér opdateringsbruger</label>
                        <label index="opening">Åbning</label>
                        <label index="newPasswordAgain" type="integer">985181</label>
                        <label index="newPassword_ok" type="integer">249160755</label>
                        <label index="newPassword_failed" type="integer">202693756</label>
+                       <label index="lang_ca" type="integer">151036235</label>
+                       <label index="lang_ba" type="integer">165586767</label>
+                       <label index="lang_kr" type="integer">218880828</label>
                </languageKey>
                <languageKey index="de" type="array">
                        <label index="UserSettings" type="integer">46681867</label>