rpms/php-captchaphp/F-12 captcha-2.2-undef.patch, NONE, 1.1 import.log, NONE, 1.1 php-captchaphp.spec, NONE, 1.1 .cvsignore, 1.1, 1.2 sources, 1.1, 1.2

Patrick Monnerat monnerat at fedoraproject.org
Mon Jul 5 11:44:45 UTC 2010


Author: monnerat

Update of /cvs/pkgs/rpms/php-captchaphp/F-12
In directory cvs01.phx2.fedoraproject.org:/tmp/cvs-serv2193/F-12

Modified Files:
	.cvsignore sources 
Added Files:
	captcha-2.2-undef.patch import.log php-captchaphp.spec 
Log Message:
* Mon Jul  5 2010 Patrick Monnerat <pm at datasphere.ch> 2.2-2
- Initial CVS import


captcha-2.2-undef.patch:
 captcha.php |    4 ++--
 index.php   |    6 +++---
 2 files changed, 5 insertions(+), 5 deletions(-)

--- NEW FILE captcha-2.2-undef.patch ---
diff -Naur captcha-2.2.orig/captcha.php captcha-2.2.new/captcha.php
--- captcha-2.2.orig/captcha.php	2010-05-20 20:42:03.000000000 +0200
+++ captcha-2.2.new/captcha.php	2010-05-25 12:10:39.000000000 +0200
@@ -164,7 +164,7 @@
 
       #-- init
       srand(microtime() + time()/2 - 21017);
-      if ($this->id) { $this->prev[] = $this->id; }
+      if (!empty($this->id)) { $this->prev[] = $this->id; }
       $this->id = $this->new_id();
       
       #-- meta informations
@@ -211,7 +211,7 @@
    
    #-- examine if captcha data is fresh
    function is_valid() {
-      return isset($this->id) && ($this->created)
+      return isset($this->id) && !empty($this->created)
           && ($this->expires > time())
           && ($this->tries > 0)
           && ($this->failures < 500)
diff -Naur captcha-2.2.orig/index.php captcha-2.2.new/index.php
--- captcha-2.2.orig/index.php	2010-05-20 20:18:31.000000000 +0200
+++ captcha-2.2.new/index.php	2010-05-25 12:18:13.000000000 +0200
@@ -3,7 +3,7 @@
   // load library and preset a few options
   define("CAPTCHA_INVERSE", 1);    // black background
   define("CAPTCHA_NEW_URLS", 0);   // no auto-disabling/hiding for the demo
-  include("captcha.php");
+  include("captchaphp/captcha.php");
 
 ?>
 <html>
@@ -109,7 +109,7 @@
 
 
 
-<form action="index.php" method="GET" x-enctype="multipart/form-data" accept-encoding="UTF-8">
+<form action="<?php echo htmlspecialchars(basename($_SERVER['SCRIPT_NAME'])); ?>" method="GET" x-enctype="multipart/form-data" accept-encoding="UTF-8">
   <textarea name="texta1" cols="40" rows="5">...</textarea>
   <?php
      // output CAPTCHA img + input box
@@ -126,7 +126,7 @@
 
 
  <div>
-  <a href="http://www.freshmeat.net/p/captchaphp">get updates (freshmeat.net)</a>
+  <a href="http://www.freshmeat.net/projects/captchaphp">get updates (freshmeat.net)</a>
   |
   <a href="captcha.tgz">download</a>
   |


--- NEW FILE import.log ---
php-captchaphp-2_2-2_fc12:F-12:php-captchaphp-2.2-2.fc12.src.rpm:1278330232


--- NEW FILE php-captchaphp.spec ---
#	The original source of this package contains a font with a forbidden
#		license.
#	The attached source tarball idoes not contain this font and has been
#		produced from the original by executing the following commands:
#
#	wget http://milki.erphesfurt.de/captcha/captcha-%{version}.tgz
#	tar xzf captcha-%{version}.tgz
#	rm -f captcha-%{version}/MyUnderwood.*
#	tar czf captcha-%{version}.nofont.tar.gz captcha-%{version}
#
#	SHA1 sums:
#	a0448d54623c9e394bbee90073a0d09d992aebda captcha-2.2.tgz
#	66fbdccc5f76d106eb3ff8fdb9c6af3441fe13fd captcha-2.2.nofont.tar.gz

%global fontdir		%{_datadir}/fonts/dejavu

Name:		php-captchaphp
Summary:	PHP very user-friendly CAPTCHA solution
Version:	2.2
Release:	2%{?dist}

#	Public Domain or any FOSS License, see README
#	We're choosing MIT because it is universally compatible with other FOSS 
#		licenses.
License:	Public Domain or MIT

Group:		System Environment/Libraries
URL:		http://freshmeat.net/projects/captchaphp/
Source0:	captcha-%{version}.nofont.tar.gz
Patch1:		captcha-2.2-undef.patch
Requires:	php-gd >= 4.3.2
Requires:	%{fontdir}
Buildarch:	noarch
BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-root

%description
  This PHP script provides a very user-friendly CAPTCHA solution.
You can easily embed it into your <form> generation scripts to
prevent spam-bot access.

It strives to be accessible and implements an arithmetic riddle
as alternative for visually impaired users. It does not require
cookies, but makes use of "AJAX" to give users visual feedback
for solving the CAPTCHA. It grants access fuzzily (when single
letters were outguessed) instead of frustrating people. And it
can be customized rather easily.


#-------------------------------------------------------------------------------
%prep
#-------------------------------------------------------------------------------

%setup -q -n captcha-%{version}
%patch1 -p 1


#-------------------------------------------------------------------------------
%build
#-------------------------------------------------------------------------------

#	Replace the font path by our (arbitrary) default font directory.

sed -i -e "/CAPTCHA_FONT_DIR/s#,.*#, '%{fontdir}/');#" captcha.php


#-------------------------------------------------------------------------------
%install
#-------------------------------------------------------------------------------

rm -rf "${RPM_BUILD_ROOT}"

#	Install directory.

install -p -d -m 755 "${RPM_BUILD_ROOT}/%{_datadir}/php/captchaphp/"


#	Install file.

install -p -m 644 captcha.php "${RPM_BUILD_ROOT}/%{_datadir}/php/captchaphp/"


#-------------------------------------------------------------------------------
%clean
#-------------------------------------------------------------------------------

rm -rf "${RPM_BUILD_ROOT}"


#-------------------------------------------------------------------------------
%files
#-------------------------------------------------------------------------------

%defattr(-, root, root, -)
%doc README index.php
%{_datadir}/php/captchaphp


#-------------------------------------------------------------------------------
%changelog
#-------------------------------------------------------------------------------

* Mon Jun 14 2010 Patrick Monnerat <pm at datasphere.ch> 2.2-2
- Using MIT license.

* Tue May 25 2010 Patrick Monnerat <pm at datasphere.ch> 2.2-1
- New upstream release.

* Mon Jul 13 2009 Patrick Monnerat <pm at datasphere.ch> 2.0-3
- Depends on font directory rather than font package: this circumvents the
  font package name change done between F10 and F11.

* Tue Jun 23 2009 Patrick Monnerat <pm at datasphere.ch> 2.0-2
- Move class files to a package-specific sub-directory.
- Get rid of build dependence on "ed".

* Mon Jun  8 2009 Patrick Monnerat <pm at datasphere.ch> 2.0-1
- Initial RPM spec file.
- Patch "nodeferror" to allow predefining CAPTCHA_* constants without
  issuing an error at include time.
- Patch "https" to detect SSL use automatically.
- Patch "undef" to fix an undefined index error.
- Patch "directcall" to improve direct call detection.
- Patch "translatable" to make module translatable through the use of
  additional CAPTCHA_* defines for texts.
- Font included in original package has an incompatible license: thus it
  is not packaged. Instead, we use a reasonable default ttf font package and
  directory.


Index: .cvsignore
===================================================================
RCS file: /cvs/pkgs/rpms/php-captchaphp/F-12/.cvsignore,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -p -r1.1 -r1.2
--- .cvsignore	23 Jun 2010 01:54:26 -0000	1.1
+++ .cvsignore	5 Jul 2010 11:44:45 -0000	1.2
@@ -0,0 +1 @@
+captcha-2.2.nofont.tar.gz


Index: sources
===================================================================
RCS file: /cvs/pkgs/rpms/php-captchaphp/F-12/sources,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -p -r1.1 -r1.2
--- sources	23 Jun 2010 01:54:27 -0000	1.1
+++ sources	5 Jul 2010 11:44:45 -0000	1.2
@@ -0,0 +1 @@
+5a82c326f9c032cd77d94812826666b1  captcha-2.2.nofont.tar.gz



More information about the scm-commits mailing list