Bug #73417 [Opn->Nab]: Missing "t"s at the end of data compiled

From: Date: Sun, 30 Oct 2016 06:55:51 +0000
Subject: Bug #73417 [Opn->Nab]: Missing "t"s at the end of data compiled
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-205068@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=73417&edit=1 ID: 73417 Updated by: rasmus@php.net Reported by: ficareli at terra dot com dot br Summary: Missing "t"s at the end of data compiled -Status: Open +Status: Not a bug Type: Bug Package: Strings related PHP Version: Irrelevant Block user comment: N Private report: N New Comment: You are using trim() incorrectly. The 2nd parameter is a list of all characters to be trimmed from the end, and you have set it to ".txt" so trailing t's will be stripped. Refer to the documenation at http://php.net/trim Previous Comments: ------------------------------------------------------------------------ [2016-10-30 02:57:53] ficareli at terra dot com dot br Description: ------------ Bug: When you run the website, some "t"s or "x" are absent (or every) at the end of the song titles. Example: "Aretha Franklin - Respec", even if the song title and filename are perfect. I have a band (loupha.com.br) and we have a website to document the songs to play, with lyrics. Offline we also use multimedia. The main page has a frameset of two windows as below http://www.loupha.com.br/Marvy/indexLyrics.html <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN"> <html> <head> <link rel="icon" href="../WebSite/Favico.png" type="image/png"> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <meta name="KeyWords" content="Loupha, rock, musica, pop, banda, Vermelho"> <meta name="DESCRIPTION" content="Loupha Rock Band Official Site"> <meta name="copyright" content="Esedra Brasil"> <meta name="robot" content="index"> <meta name="Index" content="index,follow"> <meta name="date" content="2002-03-15"> <title>LOUPHA - a Rock Legend</title> </head> <frameset cols="300,*" frameborder="no" border="0"> <frame name="indice_2" src="indiceLyrics.php?pasta='../LRC/'" marginheight="0" marginwidth="0" noresize> <frame name="master" src="Legend.htm" marginheight="0" marginwidth="8" noresize> </frameset> <noframes> <body> <h2> Por favor, troque o seu Browser por um mais novo.<br> Consulte seu provedor. Este Site usa Frames. Obrigado,<br> Ficarelli - Multimedia Designer </h2> </body> </noframes> </frameset> </html> ================================ The PHP page at left (that causes the bug) is below. I tried every type of string function to relieve the problem, but none. This bug always happened offline and online http://www.loupha.com.br/Marvy/indiceLyrics.php <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>LOUPHA INDICE</title> <link rev="made" href="mailto:ficareli@terra.com.br"> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <meta name="generator" content="NoteTab Pro 4.95"> <meta name="author" content="Marcos Ficarelli"> <meta name="description" content="automação de letras musicais"> <meta name="keywords" content="musica, letra, lyrics"> <link rel="stylesheet" type="text/css" href="CSSJS/IndiceLyrics.css"> </head> <body> <h4>Letras de Música MAIN</h4> <p><a href="indiceLyrics.php">Main</a>, <a href="indiceLyricsBrasil.php">Brasil</a>, <a href="indiceLyricsEuropeo.php">Europeo</a>, <a href="indiceLyricsItalia.php">Italia</a>, <a href="indiceLyricsOther.php">Other</a>, <a href="indiceLyricsPlay.php">Play</a>, </p> <?php ## TENTAR USAR SCANDIR(directory) - retorno total # usando opendir #-------------------- $dir = "../LRC/"; $ext = ".txt"; $dh = opendir($dir); $i = 0; while (false !== ($filename = readdir($dh))) { $pos = stripos($filename,$ext); if ($pos !== false){ $files[] = $filename; ++$i; } } sort($files); $r = 0; do { echo "<a href='Lyrics.php?letra=".htmlspecialchars($files[$r],ENT_QUOTES)."' target='master'>".trim($files[$r],$ext)."</a><br>\r\n"; ++$r; } while ($r <= $i); ?> </body> </html> Test script: --------------- BB King - How Blue Can You Ge ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=73417&edit=1

« previous php.bugs (#205068) next »