Login
Username:

Password:

Remember me



Lost Password?

Register now!

Sections

Who's Online
55 user(s) are online (44 user(s) are browsing Forums)

Members: 1
Guests: 54

trixie, more...

Support us!

Headlines

 
  Register To Post  

Backslashes in OS4Depot readmes disappear
Not too shy to talk
Not too shy to talk


See User information
Backslashes in the readme text for files on OS4Depot are removed when you view them. Maybe an addslashes() is needed somewhere?

Go to top
Re: Backslashes in OS4Depot readmes disappear
Supreme Council
Supreme Council


See User information
@xeron

I know, I have code that wraps text in 80 columns with some intelligence in it that doesn't work the way I want it to. I got it from nicomen, but unfortunately I've never bothered to learn what preg_replace does to be able to fix it.


function smartWrap($text,$width,$break="\n",$cut=1)
{
$text = str_replace("$", "&#36", $text);

if (preg_match("/[^\n]{".$width."}/",$text))
{
$text = preg_replace("/\\\\('|\")/msi","$1",preg_replace("/(.*?)(\n\n|\.\n|:\n|=+\n|\s*-{3,}\s*\n)/msie",'(preg_match("/[^\n]{$width}/mi","$1")) ? preg_replace("/(\S+)[\t ]?\n/","\$1 ","$1")."$2" : "$1$2"',$text));
$text = str_replace(""&#36"","$",$text);
return wordwrap($text,$width,$break,$cut);
}
else
{
return $text;
}
}

Vacca foeda. Sum, ergo edo

Mr Bobo Cornwater
Go to top

  Register To Post

 




Currently Active Users Viewing This Thread: 1 ( 0 members and 1 Anonymous Users )



Polls
Running AmigaOS 4 on?
AmigaOne SE/XE or microA1 12% (26)
Pegasos2 3% (8)
X5000 22% (48)
X1000 14% (30)
A1222 8% (19)
Sam 440/460 18% (40)
Classic PowerPC Amiga 2% (6)
WinUAE emulation 7% (16)
Qemu emulation 9% (21)
Total Votes: 214
The poll closed at 2025/12/1 12:00
6 Comments


Powered by XOOPS 2.0 © 2001-2024 The XOOPS Project