logo       


CVS: phpwiki/lib stdlib.php,1.224,1.225: msg#00152

Subject: CVS: phpwiki/lib stdlib.php,1.224,1.225
Update of /cvsroot/phpwiki/phpwiki/lib
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6197

Modified Files:
        stdlib.php 
Log Message:
fix glob for starting * or ?

Index: stdlib.php
===================================================================
RCS file: /cvsroot/phpwiki/phpwiki/lib/stdlib.php,v
retrieving revision 1.224
retrieving revision 1.225
diff -u -2 -b -p -d -r1.224 -r1.225
--- stdlib.php  20 Dec 2004 12:11:50 -0000      1.224
+++ stdlib.php  22 Dec 2004 19:02:29 -0000      1.225
@@ -1345,9 +1345,9 @@ function glob_to_pcre ($glob) {
     // first convert some unescaped expressions to pcre style: . => \.
     $escape = ".^$";
-    $re = preg_replace('/([^\xff])(['.preg_quote($escape).'])/', "\\1\xff\\2", 
$glob);
+    $re = preg_replace('/([^\xff])?(['.preg_quote($escape).'])/', 
"\\1\xff\\2", $glob);
 
     // * => .*, ? => .
-    $re = preg_replace('/([^\xff])\*/', '$1.*', $re);
-    $re = preg_replace('/([^\xff])\?/', '$1.', $re);
+    $re = preg_replace('/([^\xff])?\*/', '$1.*', $re);
+    $re = preg_replace('/([^\xff])?\?/', '$1.', $re);
     if (!preg_match('/^[\?\*]/',$glob))
         $re = '^' . $re;
@@ -1359,5 +1359,5 @@ function glob_to_pcre ($glob) {
     while (strcspn($re, $escape) != strlen($re)) // loop strangely needed
         $re = preg_replace('/([^\xff])(['.preg_quote($escape).'])/', 
"\\1\xff\\2", $re);
-    return str_replace("\xff", "\\", $re);
+    return strtr($re, "\xff", "\\");
 }
 
@@ -1841,4 +1841,7 @@ function printSimpleTrace($bt) {
 
 // $Log$
+// Revision 1.225  2004/12/22 19:02:29  rurban
+// fix glob for starting * or ?
+//
 // Revision 1.224  2004/12/20 12:11:50  rurban
 // fix "lib/stdlib.php:1348: Warning[2]: Compilation failed: unmatched 
parentheses at offset 2"



-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. 
http://productguide.itmanagersjournal.com/


Ruby Jobs
Java Jobs
Jobs in California
more...
what
job title, keywords
where
city, state, zip
jobs by job search
Search:
Java, servers, webhosting, windows, cisco ...
more...
<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
encryption.gpg....    ietf.rfc822/199...    freebsd.devel.i...    lang.haskell.li...    mail.squirrelma...    web.zope.plone....    yellowdog.gener...    text.xml.xalan....    recreation.phot...    kde.devel.educa...    hardware.bus.ca...    printing.ghosts...    voip.peering/20...    assembly/2006-0...    org.user-groups...    culture.interne...    network.i2p/200...    boot-loaders.ya...    xfree86.render/...    qnx.openqnx.dev...    jakarta.velocit...    user-groups.pal...   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe