php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #73417 Missing "t"s at the end of data compiled
Submitted: 2016-10-30 02:57 UTC Modified: 2016-10-30 06:55 UTC
From: ficareli at terra dot com dot br Assigned:
Status: Not a bug Package: Strings related
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
 [2016-10-30 02:57 UTC] 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


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2016-10-30 06:55 UTC] rasmus@php.net
-Status: Open +Status: Not a bug
 [2016-10-30 06:55 UTC] rasmus@php.net
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
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Nov 13 22:01:29 2024 UTC