php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #14985 Language when searching on mirrors
Submitted: 2002-01-10 19:04 UTC Modified: 2002-06-16 16:09 UTC
From: msopacua at idg dot nl Assigned:
Status: Closed Package: Website problem
PHP Version: 4.1.1 OS: Not relevant
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: msopacua at idg dot nl
New email:
PHP Version: OS:

 

 [2002-01-10 19:04 UTC] msopacua at idg dot nl
The following has been discussed with Gorba, but he didn't have the time to look into it and requested I reported it here.

Basically - manual-lookup.php already is prepared for a language. Search.php however, doesn't know about it.

The following unified diff, shows a basic implementation of how it can be supported.

Without this, even if you read the english manual, the search box, will direct you to the manual, in the default language for the mirror you're visiting. This may not be what you want.

--- ./search.php.dist   Wed Jan  9 20:19:14 2002
+++ ./search.php        Fri Jan 11 00:58:26 2002
@@ -13,11 +13,19 @@
 if (isset($prevsearch) && get_magic_quotes_gpc())
         $prevsearch = stripslashes($prevsearch);

+if (isset($lang) && get_magic_quotes_gpc())
+{
+       $lang = stripslashes($lang);
+}
+else
+{
+       $lang = ereg_replace("^([a-z]{2}).*$", "\\1". $HTTP_ACCEPT_LANGUAGE);
+}
 if ($pattern) {
        setcookie("prevsearch",$pattern,0,"",".php.net");

        if ($show=="quickref") {
-               header("Location: manual-lookup.php?pattern=".urlencode($pattern));
+               header("Location: manual-lookup.php?pattern=".urlencode($pattern)."&lang=".urlencode($lang));
                exit;
        }
        $location = "http://www.progressive-comp.com/Lists/";
@@ -59,7 +67,7 @@
                header("Location: ".$location."?".$query);
                exit;
        }
-}
+}

 if (file_exists("configuration.inc")) {
   include_once 'configuration.inc';
@@ -101,6 +109,7 @@
 ?>
 <h1>Search</h1>
 <form action="<?php echo $form;?>" method="post">
+<input type="hidden" name="lang" value="<?php echo htmlspecialchars($lang); ?>">
 <table cellspacing="0" cellpadding="2" border="0" align="center">
 <tr valign="top">
 <td align="right">

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-06-16 16:09 UTC] sander@php.net
This bug has been fixed in CVS. You can grab a snapshot of the
CVS version at http://snaps.php.net/. In case this was a documentation 
problem, the fix will show up soon at http://www.php.net/manual/.
In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites.
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon May 27 05:01:31 2024 UTC