Login
Username:

Password:

Remember me



Lost Password?

Register now!

Sections

Who's Online
253 user(s) are online (210 user(s) are browsing Forums)

Members: 0
Guests: 253

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
Pegasos2
X5000
X1000
A1222
Sam 440/460
Classic PowerPC Amiga
WinUAE emulation
Qemu emulation
Total Votes: 126
The poll will close at 2025/12/1 12:00
2 Comments


Powered by XOOPS 2.0 © 2001-2024 The XOOPS Project